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

Code completion using LSP and clangd

<< < (81/92) > >>

kakas:

--- Quote from: Pecan on April 10, 2024, 07:26:23 am ---Important:
You have to use the clangd.exe under the mingw64 folder. Not the clang64 folder.
Using the wrong clangd.exe is what was causing all the diagnostic errors.

--- End quote ---

oh I think this is causing the problem. I have no clangd.exe or clang.exe in my mingw64 folder. It's only present in clang64 folder.
Is there another command that I should be running from the msys terminal to download the correct clangd.exe? because I remember running only a single command from the guide.

kakas:
ran the other command from the guide "pacman -S mingw-w64-x86_64-clang-tools-extra" which downloaded the executables to mingw64 folder instead of clang64.
sorry I got mixed up by the commands in the guide at first (attached screenshot of command prompt showing version details of clangd.exe and c++.exe)

Went through the enabling plugin procedure again to see if it fixed the issue. But no pogress.

Despite the "To run Clangd_Client, restart CodeBlocks after setting up a compiler...." error,
Code blocks seems to compile files just fine. Compiler installation directory(contains clangd.exe and clang.exe) C:\msys64\mingw64.
So I am not sure if the problem comes from CB not finding a default compiler.

kakas:

--- Quote from: Pecan on April 10, 2024, 07:26:23 am ---Your compiler is just fine where it is.
But for the time being lets use the one in the April 1 nightly so we both are in sync with each other.
You can change it later if you wish.

--- End quote ---

???
wait a minute. the zip file of the nightly build(from 1st April) that I downloaded didn't had any compiler in it, just a folder named "shared"

kakas:
SOLVEDDD

I had to set the default compiler to *No-compiler*
before enabling or disabling any plugin.

this time(having no-compiler as default) it didn't gave the error pop-up on the bottom right when enabling the Clangd_Client plugin, but said CB needs to restart for the plugin to function properly.

After setting up the clangd.exe path in the editor settings and restarting again, the plugin works. And it's awesome  ;D ;D ;D

Pecan:

--- Quote from: kakas on April 10, 2024, 09:40:46 am ---
--- Quote from: Pecan on April 10, 2024, 07:26:23 am ---Your compiler is just fine where it is.
But for the time being lets use the one in the April 1 nightly so we both are in sync with each other.
You can change it later if you wish.

--- End quote ---

???
wait a minute. the zip file of the nightly build(from 1st April) that I downloaded didn't had any compiler in it, just a folder named "shared"

--- End quote ---

Actually, there is a URL on the Nightly announcement that can be used to download the compiler that was used to make the Nightly CodeBlocks.

But you've solved your setup problems already.
Thanks for your patience and your persistence.
This has informed me on what can go awry and how to improve the instructions on setting up Clangd_client.

You might want to go through the list of plugins (mainmenu/plugins/manage plugins) and disable or uninstall the plugins that you do not use.  It'll unclutter your logs section.

If you haven't found it yet, the "LSP messages" tab in the  log section is the one that contains the output from Clangd/Clangd_client  and may have suggestions on how to correct syntax or symbol references.
If you see a message that contains "(fix available)" you can right-mouseClick on the message and apply the fix automatically if you agree with the suggested fix.

In the coming Nightly, you will also be able to Alt-LeftMouseClick on the red/green warning/error box in the margin to apply any suggested fix.
But you might have to update to mingw64/clangd.exe version 18 (when it becomes available in msys64) before you can take full advantage of this.

Regards

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version