Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Code completion using LSP and clangd

<< < (30/92) > >>

Pecan:

--- Quote from: ollydbg on July 22, 2022, 07:12:37 am ---Hi, Pecan, I think this patch is still needed to handle the wxString to char* convertion, the char* should be UTF-8 format.

This is against rev69.



--- Code: ----------------------- clangd_client/src/LSPclient/client.cpp --------------------
index c1d5d59..c6f8c22 100644
@@ -2649,7 +2649,7 @@ void ProcessLanguageClient::LSP_DidChange(cbEditor* pEd)
         didChangeEvent.range = range;
     }
 
-    didChangeEvent.text = edText;
+    didChangeEvent.text = edText.ToStdString(wxConvUTF8);
     std::vector<TextDocumentContentChangeEvent> tdcce{didChangeEvent};
     DocumentUri docuri = DocumentUri(fileURI.c_str());
     // **debugging**

--- End code ---

--- End quote ---

Applied locally. Will test it for awhile.
If ok, it'll be in rev 70.

Thanks

ollydbg:
I see one bug, I'm not sure it is a clangd bug or our client plugin bug.

When I do code refactoring, I mean I want to rename a variable aaa to bbb.

If there is a line:


--- Quote ---wxLogMessage("aaa", aaa);

--- End quote ---

Then I will get this:


--- Quote ---wxLogMessage("bbb", aaa);

--- End quote ---

maybe, clangd does not give us the column information of a variable? It just tell use the line information?

Pecan:

--- Quote from: ollydbg on July 24, 2022, 06:15:38 am ---I see one bug, I'm not sure it is a clangd bug or our client plugin bug.

When I do code refactoring, I mean I want to rename a variable aaa to bbb.

If there is a line:


--- Quote ---wxLogMessage("aaa", aaa);

--- End quote ---

Then I will get this:


--- Quote ---wxLogMessage("bbb", aaa);

--- End quote ---

maybe, clangd does not give us the column information of a variable? It just tell use the line information?

--- End quote ---

Do you mean that the unquoted aaa should have been changed to the unquoted bbb (the second parameter) ?

ollydbg:

--- Quote from: Pecan on July 24, 2022, 06:58:20 am ---
--- Quote from: ollydbg on July 24, 2022, 06:15:38 am ---I see one bug, I'm not sure it is a clangd bug or our client plugin bug.

When I do code refactoring, I mean I want to rename a variable aaa to bbb.

If there is a line:


--- Quote ---wxLogMessage("aaa", aaa);

--- End quote ---

Then I will get this:


--- Quote ---wxLogMessage("bbb", aaa);

--- End quote ---

maybe, clangd does not give us the column information of a variable? It just tell use the line information?

--- End quote ---

Do you mean that the unquoted aaa should have been changed to the unquoted bbb (the second parameter) ?

--- End quote ---

Yes.

BlueHazzard:
Hi, not quite sure what is happening, and i did not investigate, but i got a crash and this backtrace, just wanted to note it here:

--- Code: ---AddrPC           Params
00007FFC87E084EB 00000158724B49E0 0000002690BFE4F0 00000000FFFF86AD  clangd_client.dll!Parser::LSP_ParseSemanticTokens
00007FFC87E13403 00000158724B49E0 00000158771FF080 0000000000000000  clangd_client.dll!Parser::OnLSP_RequestedSemanticTokensResponse
00007FFC87DB64F1 000001586D6EB3F0 00000158771FF080 0000002690BFEED0  clangd_client.dll!ClgdCompletion::OnLSP_Event
00007FFC2F35398C 000001586CB04130 000001586D6EB3F0 00007FFC2A605B5E  wxmsw315ud_gcc_custom.dll!wxAppConsoleBase::HandleEvent
00007FFC2F353A0D 000001586CB04130 000001586D6EB3F0 000001586D50E880  wxmsw315ud_gcc_custom.dll!wxAppConsoleBase::CallEventHandler
00007FFC2F42DBF4 000001586D50E8E0 000001586D6EB3F0 00000158771FF080  wxmsw315ud_gcc_custom.dll!wxEvtHandler::ProcessEventIfMatchesId
00007FFC2F42E90A 000001586D6EB3F0 00000158771FF080 00000158771FF080  wxmsw315ud_gcc_custom.dll!wxEvtHandler::SearchDynamicEventTable
00007FFC2F42E07A 000001586D6EB3F0 00000158771FF080 0000002690BFF0C0  wxmsw315ud_gcc_custom.dll!wxEvtHandler::TryHereOnly
00007FFC2FC31040 000001586D6EB3F0 00000158771FF080 0000015870E46080  wxmsw315ud_gcc_custom.dll!wxEvtHandler::TryBeforeAndHere
00007FFC2F42DE83 000001586D6EB3F0 00000158771FF080 000001586D6EB3F0  wxmsw315ud_gcc_custom.dll!wxEvtHandler::ProcessEvent
00007FFC2F42DF7F 000001587244F920 00000158771FF080 0000002690BFF120  wxmsw315ud_gcc_custom.dll!wxEvtHandler::DoTryChain
00007FFC2F42DF10 000001587244F920 00000158771FF080 000001586CAB5FB0  wxmsw315ud_gcc_custom.dll!wxEvtHandler::ProcessEventLocally
00007FFC2F42DE95 000001587244F920 00000158771FF080 00000158773507D0  wxmsw315ud_gcc_custom.dll!wxEvtHandler::ProcessEvent
00007FFC2F42DA98 000001587244F920 0000000000000000 000001586CB042F8  wxmsw315ud_gcc_custom.dll!wxEvtHandler::ProcessPendingEvents
00007FFC2F3535ED 000001586CB04130 00007FFC2F4FFA99 000001586CB04130  wxmsw315ud_gcc_custom.dll!wxAppConsoleBase::ProcessPendingEvents
00007FFC2F37666E 000001587479F1C0 0000000000000040 0000002690BFF380  wxmsw315ud_gcc_custom.dll!wxEventLoopManual::ProcessEvents
00007FFC2F37677D 000001587479F1C0 000001587479F1D4 000001587479F100  wxmsw315ud_gcc_custom.dll!wxEventLoopManual::DoRun
00007FFC2F376234 000001587479F1C0 000001586CB042F0 000001587479F1C0  wxmsw315ud_gcc_custom.dll!wxEventLoopBase::Run
00007FFC2F352E88 000001586CB04130 0000000000000055 000001586CAB5FB0  wxmsw315ud_gcc_custom.dll!wxAppConsoleBase::MainLoop
00007FFC2F352BB2 000001586CB04130 00007FFCDC9A03E0 00007FFCDC980000  wxmsw315ud_gcc_custom.dll!wxAppConsoleBase::OnRun
00007FFC2F59BA17 000001586CB04130 000001586CB00000 0000000000000000  wxmsw315ud_gcc_custom.dll!wxAppBase::OnRun
00007FF742BF5C8A 000001586CB04130 00007FFC3028D7B0 000001586B0CC050  codeblocks.exe!CodeBlocksApp::OnRun
00007FFC2F3A0FA2 00007FFC3028D7B0 000001586B0CC050 000001586CAAF898  wxmsw315ud_gcc_custom.dll!wxEntryReal
00007FFC2F436B60 00007FFC3028D7B0 000001586B0CC050 0000000000000000  wxmsw315ud_gcc_custom.dll!wxEntry
00007FFC2F436C45 00007FF742BF0000 0000000000000000 000001586B0C3987  wxmsw315ud_gcc_custom.dll!wxEntry
00007FF742BF2544 00007FF742BF0000 0000000000000000 000001586B0C3987  codeblocks.exe!WinMain
00007FF742BF13B1 0000000000000000 0000000000000000 0000000000000000  codeblocks.exe!__tmainCRTStartup
00007FF742BF14C6 0000000000000000 0000000000000000 0000000000000000  codeblocks.exe!WinMainCRTStartup
00007FFCDC997034 0000000000000000 0000000000000000 0000000000000000  KERNEL32.DLL!BaseThreadInitThunk
00007FFCDD9E2651 0000000000000000 0000000000000000 0000000000000000  ntdll.dll!RtlUserThreadStart


--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version