Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
Code completion using LSP and clangd
Pecan:
--- Quote from: ollydbg on November 09, 2022, 02:49:06 am ---...
When editing the "#include <" or other statement, I see an annoying messagebox, I just translate the messagebox to log:
--- Code: ---From 96e57a13033c2f67e45813ad423e2d6c077488bb Mon Sep 17 00:00:00 2001
From: asmwarrior <a@b.com>
Date: Sat, 5 Nov 2022 18:10:33 +0800
Subject: change the annoying messagebox to log
diff --git a/clangd_client/src/codecompletion/parser/LSP_symbolsparser.cpp b/clangd_client/src/codecompletion/parser/LSP_symbolsparser.cpp
index 65c2c5a..a2868de 100644
--- a/clangd_client/src/codecompletion/parser/LSP_symbolsparser.cpp
+++ b/clangd_client/src/codecompletion/parser/LSP_symbolsparser.cpp
@@ -2198,7 +2198,9 @@ Token* LSP_SymbolsParser::DoHandleClass(EClassType ct, int lineNumber, int lastL
newToken->m_IsAnonymous = true;
#if defined(cbDEBUG)
wxString msg((wxString::Format("Trying to DoParse recursion in %s():%d", __FUNCTION__, __LINE__)));
- cbMessageBox(msg, "Assert(non fatal)");
+ CCLogger::Get()->DebugLog(msg);
+ wxString str = wxString::Format("m_Buffer = %s, next = %s", m_Buffer, next);
+ //cbMessageBox(msg, "Assert(non fatal)");
#endif
break; //(ph 2021/10/13)
/// DoParse(); // recursion
--- End code ---
BTW: I really do not know why this happens, do you want to parse a single line using the hand written parser ourselves?
--- End quote ---
I'll make that annoying cbMessageBox into a log msg instead.
--- Code: ---#if defined(cbDEBUG)
// FIXME (ph#): Find out why this happens when trying to find a class ancestor.
wxString msg((wxString::Format("Trying to DoParse recursion in %s():%d", __FUNCTION__, __LINE__)));
//-cbMessageBox(msg, "Assert(non fatal)");
CCLogger::Get()->DebugLog(msg);
#endif
break; //(ph 2021/10/13)
/// DoParse(); // recursion
--- End code ---
The code is trying to parse out the ancestor of a class to add to the symbols tree. Clangd has no protocol msg to achieve that, so I was trying to use the old CodeCompletion code to parse it from the source line.
Do you have any steps you can give me to re-create the situation.
Thanks
Pecan:
If There are no objections, I'd like to commit Clangd_client as a contrib.
It runs fine on both Windows and Linux.
And I believe Andrew has it working on Mac.
Thanks
gd_on:
Cool.
I see that clangd_client plugin is now included in contrib plugins.
Three details :
* within contrib, it's version 87 though on your svn site it's version 88;
* CodeBlocks_wx32_64.workspace has not been updated to include the clangd_client but all other workspaces are OK;
* the documentation-install folder is not there.
gd_on
Miguel Gimenez:
Conversely, clangd_client_wx32.cbp is missing although CodeBlocks_wx32.workspace includes it (ticket #1327).
Miguel Gimenez:
File clangd_client_wx31.cbp has this linker option:
--- Code: ---<Add option="-m64" />
--- End code ---
but it is a 32-bit project.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version