Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
Code completion using LSP and clangd
Pecan:
--- Quote from: tomay3000 on April 07, 2024, 01:16:05 pm ---
--- Quote from: Pecan on April 04, 2024, 06:09:29 pm ---
--- Quote from: tomay3000 on April 04, 2024, 03:48:27 pm ---- "Find declaration of: ..." does not work for me.
- "Reparse this project" has become a must so that the menu entry "Find declaration of: ..." appears.
What is going wrong ?
OS : Windows 7 with SP1 x64
C::B : Nightly build 13496
clangd : 18.1.2
--- End quote ---
Not enough info.
Can you give us a simple example (code) to recreate the problem?
What steps can we perform to recreate the problem?
--- End quote ---
Here is my C::B project
Note that if I revert to using Code Completion back, then "Find declaration of: ..." starts working as expected.
--- End quote ---
@tomay3000
Thanks for providing the source.
Responses from Clangd are dependent on the symbols produced by the compiler being used.
Your project is using what looks like a 32 bit mingw compiler.
Where did you obtain that compiler so I can mirror your environment.
Using my default gcc 64 bit compiler gets a slew of compiler errors which means I won't get the same errors you do.
Also, what declaration are you trying to display so I can attempt to mimic the error.
tomay3000:
--- Quote from: Pecan on April 07, 2024, 06:18:16 pm ---
--- Quote from: tomay3000 on April 07, 2024, 01:16:05 pm ---
--- Quote from: Pecan on April 04, 2024, 06:09:29 pm ---
--- Quote from: tomay3000 on April 04, 2024, 03:48:27 pm ---- "Find declaration of: ..." does not work for me.
- "Reparse this project" has become a must so that the menu entry "Find declaration of: ..." appears.
What is going wrong ?
OS : Windows 7 with SP1 x64
C::B : Nightly build 13496
clangd : 18.1.2
--- End quote ---
Not enough info.
Can you give us a simple example (code) to recreate the problem?
What steps can we perform to recreate the problem?
--- End quote ---
Here is my C::B project
Note that if I revert to using Code Completion back, then "Find declaration of: ..." starts working as expected.
--- End quote ---
@tomay3000
Thanks for providing the source.
Responses from Clangd are dependent on the symbols produced by the compiler being used.
Your project is using what looks like a 32 bit mingw compiler.
Where did you obtain that compiler so I can mirror your environment.
Using my default gcc 64 bit compiler gets a slew of compiler errors which means I won't get the same errors you do.
Also, what declaration are you trying to display so I can attempt to mimic the error.
--- End quote ---
The compiler I am using is: https://github.com/tomay3000/mingw-builds-binaries/releases/download/13.2.0-rt_v11-rev1/i686-13.2.0-release-posix-sjlj-ucrt-rt_v11-rev1.7z
Any declaration gives an error.
Pecan:
@ tomay3000
I'll install that compiler and see what's going on.
BTW: what clangd.exe did you setup in Clangd_client and where can I get it to also mirror your environment?
Pecan:
--- Quote from: kakas on April 09, 2024, 05:28:18 pm ---Hello sir, I tried to install your plugin but the plugin gets disabling upon resart. I am following this https://wiki.codeblocks.org/index.php/CB_Clangd_Client#Windows:_Compiler_Clangd.2FLLVM_Package_Installerguide.
I installed a nightly build of Code blocks, from 16th December 2023.
And downloaded,installed clang.exe with the following command: "pacman -S mingw-w64-clang-x86_64-clang-tools-extra".
And disabled the "code completion" plugin, then enabled "Clangd_Client".
Set my default compiler to clang.exe in code blocks compiler setting.
But after restarting code blocks, clangd_client remains disabled and there is no option of "clangd_client" on the left of editor settings.
I am not sure if following ONLY the "Configuring clangd_client" and "Windows: Compiler Clangd/LLVM Package Installer" section of the guide has led to this error or am I misinterpreting the instruction about setting a compiler before restarting.
--- End quote ---
I've moved this message here from personal msgs so that we all can proffer from the solution.
@ kakas
I'd suggest that you uninstall (or remove) that old nightly 16 December 2023 and install this the April 1, 2024 version instead since it has many additions and fixes over last years version.
https://forums.codeblocks.org/index.php/topic,25755.msg175319.html#msg175319
You don't actually "install" it. You just download and unzip the three zips into a newly made folders.
cbNightly <-- new main nightly folder
codeblocks <-- contains all the codeblocks zips except the compiler zip.
mngw64 <-- contains the compiler contents
Start a command session click the windows key then type "cmd" and enter key.
From with the cmd window "cd cbNightly\codeblocks
Type: codeblocks.exe /d
Question: Does codeblocks show ok?
If so, Check that the compilers tool chain is set to the download mingw64 executables.
Click mainMenu/Settings/Compiler/Toolchain executables
See second image below.
Please excuse me if I insult your intelligents. I just want to get the basics out of the way so we have approximately the same setup to work with.
A few questions so I can get a picture of your system setup.
1) Are you actually compiling with Clang.exe or with mingw64 or mingw32.
2) Do you work in 32 bit C++ or 64bit C++ ?
3) After installing the nightly, click on mainmenu/plugins/manage plugins.
Is clangd_client listed. See image below.
Is codecompletion disabled? Is clangd_client enabled?
kakas:
:D thank you for the reassuring reply.
about the issue. There's another thing I would like to add.
when enabling the the plugin, A pop up message appears on the bottom right of the screen.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version