News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

clangd code completion

Started by juxin5, October 11, 2024, 07:38:40 AM

Previous topic - Next topic

juxin5

hello, first time here.
I followed the wiki page to enable the Clangd plugin, but the code completion is not working.
Is there something I am missing?
I'm using build 13539 on windows.

stahta01

These directions? https://wiki.codeblocks.org/index.php/CB_Clangd_Client

Which compiler toolchain did you install/use?
Which clangd did you install/use?

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

juxin5

thx for the reply.
yes, I use the LLVM win64.exe one.
I'm not sure what compiler toolchain you mentioned means, but if it's compiler used in cb, it's gnu gcc compiler.

stahta01

Quote from: juxin5 on October 11, 2024, 07:22:59 PM
thx for the reply.
yes, I use the LLVM win64.exe one.
I'm not sure what compiler toolchain you mentioned means, but if it's compiler used in cb, it's gnu gcc compiler.

Without knowing the compiler toolchain you are using I cannot help you.
And, I feel too bad today to explain where to find the info.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Pecan

#4
Quote from: juxin5 on October 11, 2024, 07:38:40 AM
hello, first time here.
I followed the wiki page to enable the Clangd plugin, but the code completion is not working.
Is there something I am missing?
I'm using build 13539 on windows.

I'll try to help here. But first, let me come up with some questions that will put us on the same page to determine what you mean by "is not working". We need some clues.
I'll reply tomorrow.

Thanks for your patients.

juxin5

thx for the reply.

When I type 3 letters, the classic code completion will list the possible candidates. By "not working", I mean that the list will not show.

MichaelAgarkov

Quote from: juxin5 on October 11, 2024, 07:22:59 PM
thx for the reply.
yes, I use the LLVM win64.exe one.
I'm not sure what compiler toolchain you mentioned means, but if it's compiler used in cb, it's gnu gcc compiler.

Run these commands:
clangd --version
gcc --version
to get the versions.

juxin5

Quote from: Michael Agarkov on October 12, 2024, 01:35:54 PM

Run these commands:
clangd --version
gcc --version
to get the versions.

thx for the reply.
the clangd version is 18.1.8
as for the gcc version, I don't know why the terminal says it can't identify "gcc". If I don't have it, how did I compile in cb?

MichaelAgarkov

Quote from: juxin5 on October 12, 2024, 02:57:34 PM
Quote from: Michael Agarkov on October 12, 2024, 01:35:54 PM

Run these commands:
clangd --version
gcc --version
to get the versions.

thx for the reply.
the clangd version is 18.1.8
as for the gcc version, I don't know why the terminal says it can't identify "gcc". If I don't have it, how did I compile in cb?

GCC used by C::B is located in settings (see screenshot), did you install GCC seperately or did you install C::B bundled with it?

juxin5

Quote from: Michael Agarkov on October 12, 2024, 03:13:30 PM

GCC used by C::B is located in settings (see screenshot), did you install GCC seperately or did you install C::B bundled with it?

thx for the reply.

I install cb with the compiler.

MichaelAgarkov

Quote from: juxin5 on October 12, 2024, 03:55:56 PM
Quote from: Michael Agarkov on October 12, 2024, 03:13:30 PM

GCC used by C::B is located in settings (see screenshot), did you install GCC seperately or did you install C::B bundled with it?

thx for the reply.

I install cb with the compiler.

Go to C:\Program Files\CodeBlocks\MinGW\bin and run:
gcc --version

juxin5

Quote from: Michael Agarkov on October 12, 2024, 04:03:46 PM

Go to C:\Program Files\CodeBlocks\MinGW\bin and run:
gcc --version

thx for the reply.
It's 8.1.0


juxin5

Quote from: Michael Agarkov on October 12, 2024, 04:21:15 PM
I think your problem might be the same as in https://forums.next.codeblocks.org/index.php/topic,24357.msg169412.html#msg169412

thx for the reply.

so my clangd.exe is in "C:\Program Files\LLVM\bin\clangd.exe"
is that the problem? how do I fix it, like how do i get the file in the right path?

MichaelAgarkov

AFAIK you need to use MSYS2 and install GCC and Clang together in the same environment and use "mingw-w64-clang-x86_64-clang-tools-extra" for it to work properly.