Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
Code completion using LSP and clangd
ollydbg:
There are some other issues in rev67, which I never see in rev66.
When editing the comments, I got this message box:
--- Code: ---[Window Title]
codeblocks.exe
[Content]
LSP: trying to get AST for non-added document
[OK]
--- End code ---
I really don't know why this will happen.
Pecan:
--- Quote from: ollydbg on July 16, 2022, 04:41:59 pm ---There are some other issues in rev67, which I never see in rev66.
When editing the comments, I got this message box:
--- Code: ---[Window Title]
codeblocks.exe
[Content]
LSP: trying to get AST for non-added document
[OK]
--- End code ---
I really don't know why this will happen.
--- End quote ---
Acknowledge. I get this when adding a new file to the project. Specifically (for me) MainMenu/File/new/file...
It's caused because CB invokes OnEditorActivated() before setting the editor's ProjectFile member (pointing to the parent project) and ~proxyProject~ grabs it thinking it's a non-project file.
It'll be fixed in the next commit.
Pecan:
--- Quote from: ollydbg on July 16, 2022, 03:13:32 pm ---
--- Quote from: ollydbg on July 16, 2022, 02:53:01 pm ---OK, it looks like the change in rev67 is here:
--- Code: ---@@ -1664,9 +1683,13 @@ bool ProcessLanguageClient::LSP_DidOpen(cbEditor* pcbEd)
// save current length of the file
m_FileLinesHistory[pcbEd] = pCntl->GetLineCount();
- wxString strText = pCntl->GetText();
- //-const char* pText = strText.mb_str(); //works //(ph 2022/01/17)
- const char* pText = strText.ToUTF8(); //ollydbg 220115 did not solve illegal utf8char
+ #if wxCHECK_VERSION(3,1,5) //3.1.5 or higher
+ wxString strText = pCntl->GetText().utf8_string(); //solves most illegal utf8chars
+ #else
+ //const char* pText = strText.mb_str(); //works //(ph 2022/01/17)
+ wxString strText = pCntl->GetText().ToUTF8(); //ollydbg 220115 did not solve illegal utf8chars
+ #endif
+ const char* pText = strText.c_str();
--- End code ---
This code change looks wrong (cause my issue) here.
--- End quote ---
I just revert this changes in rev67, and rebuild the clangd_client plugin, and my issue is gone! :)
--- End quote ---
Thanks, I'll revert that change for the next commit.
Question: Do you NOT use utf8 in CB editors?
The line containing " wxString strText = pCntl->GetText().utf8_string();" was advertised as solving non-utf8 chars in a buffer. And does so for me.
What editor encoding do you use?
ollydbg:
--- Quote from: Pecan on July 16, 2022, 06:16:54 pm ---
Question: Do you NOT use utf8 in CB editors?
The line containing " wxString strText = pCntl->GetText().utf8_string();" was advertised as solving non-utf8 chars in a buffer. And does so for me.
What editor encoding do you use?
--- End quote ---
Yes, I use UTF8 in the C::B editors. My source code is also in UTF8 format.
My question: The function wxString::utf8_string() returned a std::string type, but why you still use a wxString to hold the returned value? Maybe there is a conversion from std::string to wxString?
My OS: Windows7 64bit, but my OS' local language setting is Simplified Chinese. My guess is that some conversion is wrong here, maybe, a std::string to wxString is using some local language setting, and its not necessary.
ollydbg:
--- Quote from: Pecan on July 16, 2022, 06:08:55 pm ---
--- Quote from: ollydbg on July 16, 2022, 04:41:59 pm ---There are some other issues in rev67, which I never see in rev66.
When editing the comments, I got this message box:
--- Code: ---[Window Title]
codeblocks.exe
[Content]
LSP: trying to get AST for non-added document
[OK]
--- End code ---
I really don't know why this will happen.
--- End quote ---
Acknowledge. I get this when adding a new file to the project. Specifically (for me) MainMenu/File/new/file...
It's caused because CB invokes OnEditorActivated() before setting the editor's ProjectFile member (pointing to the parent project) and ~proxyProject~ grabs it thinking it's a non-project file.
It'll be fixed in the next commit.
--- End quote ---
OK, thanks for the explanation.
Sometimes, when a new editor get opened. (mostly happens when I use find declaration to open a new editor), there is a message shown in the right bottom corner of the C::B's main frame immediately after the editor opened, and it said this file is not parsed yet. I also believe this is a wrong event sequence handling issue.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version