262 questions
0
votes
1
answer
36
views
Getting clangd to work when compiling with MSVC
I'm using Windows 11, CMake, VSCodium, clangd 21.1.0 and Visual Studio 2022 Community. I can compile my project just fine but I don't know how to get clangd set up and working, I know that it's ...
0
votes
0
answers
52
views
Clion 2025.2.4:Clangd: In template: call to '__builtin_operator_delete' selects non-usual deallocation function
I use the tutorial online to solve this problem.
Like this https://youtrack.jetbrains.com/issue/CPP-29091/In-template-call-to-builtin-operator-delete-selects-non-usual-de#focus=Comments-27-6067190.0-.
...
5
votes
2
answers
332
views
clangd in CUDA mode treats host-side C++ standard library as unavailable (std::format, chrono, iostream errors)
Problem
I'm trying to use clangd for LSP in Neovim with CUDA .cu files, but it fails to recognize standard C++ library features on the host side. Even simple host functions using std::format, std::...
2
votes
1
answer
147
views
Clangd query driver still uses clang source dir
Recently i've been working on some project with GNU arm compiler for C++ project. I've configured clangd to use this compiler with query-driver as clangd documentation recommends. The problem is ...
1
vote
0
answers
53
views
Enabling Code Templates on Eclipse CDT (LSP)
With (old) Eclipse CDT we could define templates under Preferences > C/C++ > Editor > Templates which could be inserted into the code using CTRL + SPACE shortcut.
After upgrading to C++20 I ...
0
votes
1
answer
100
views
Force clangd to treat .h file as C header
Clangd LSP in Neovim keeps giving C++ diagnostics for an .h file. How do I force it to give C header diagnostics?
0
votes
0
answers
48
views
.clang-format not putting item on new line [duplicate]
The following is my .clang-format file:
IndentWidth: 2
IndentCaseLabels: true
AllowShortEnumsOnASingleLine: false
ColumnLimit: 100
BinPackArguments: false
BinPackParameters: false
...
0
votes
0
answers
213
views
How do you set up clangd properly with a specific toolchain?
I'm using clangd for an embedded systems project in VS Code because it works way better for what I'm trying to do than Microsoft's C/C++ extension for intellisense (and also I had a few cases where my ...
2
votes
0
answers
37
views
clangd LSP with CMock
I’m working on an embedded project that runs on an Infineon TriCore MCU.
The certified TriCore‑GCC and its binary libraries are Windows‑only, but I do most work on Linux.
To get quick syntax checks ...
1
vote
1
answer
71
views
Clangd find definition in external library
I have a setup with a project written in C that is statically linked with a library. The sources of the library are in a different folder somewhere else on the system.
I am using emacs and lsp-mode ...
2
votes
1
answer
86
views
How to disable fillers in COC
I am using Clangd as LSP server.
"inlayHint.display": false and "clangd.arguments": ["--function-arg-placeholders=0"]" work to disable the placeholders in functions ...
0
votes
0
answers
247
views
clangd in vs code can't find standard headers
I am using the Windows 11 operating system.
I have both gcc and clang on my computer. My MinGW was downloaded from the winlibs website, but the latest version of MinGW lacks clang, so I downloaded it ...
1
vote
0
answers
122
views
Why `usage.c` file in the `git` project causes the Vscode extension 'clangd' server to crash?
I use the clangd extension in vscode. When I open a usage.c file in git project, it crashes.
The log here
When I transplant the file to other project, the clangd server crash on the transplanted file ...
0
votes
0
answers
69
views
clangd can't resolve ANTLR4 headers in VS Code Dev Container with compile_commands.json
I'm trying to set up a VS Code Dev Container using clangd to get proper C++ autocompletion and diagnostics for a project that uses the ANTLR4 C++ runtime. I have a working Docker-based development ...
0
votes
2
answers
119
views
Clang: compile_commands.json "file" - attribute - What value?
What value do i have to use for the file - attribute in a compile_commands.json for clang?
Here it says:
https://clang.llvm.org/docs/JSONCompilationDatabase.html
file: The main translation unit ...
0
votes
1
answer
86
views
How to make project visible to clangd?
I was trying to use clangd to make a tool for LLM Agent to let LLM search for linux-kernel source code. I am using this github project to help me with this.
However, when I use textDocument/definition ...
1
vote
1
answer
127
views
Correct format for JSONRPC for Clangd
I am attempting to send JSON to Clangd on my desktop using Python. I see in the terminal window that Clangd says:
I[15:52:46.580] Warning: Missing Content-Length header, or zero-length message.
"...
2
votes
1
answer
247
views
How to Use Clangd correcly without compile from time to time [duplicate]
From what I understand, Clangd relies on the compilation process. This means I need to compile my code periodically to get the most up-to-date syntax error information. (and every time I need to ...
1
vote
1
answer
208
views
Visual Studio (not VSCode) Language Server Protocol Failing Immediately with ConnectionLostException (using Clangd as server)
Has anybody had any success with getting Visual Studio (NOT VSCode) working with clangd?
I have been trying to follow the guide at https://learn.microsoft.com/en-us/visualstudio/extensibility/adding-...
2
votes
1
answer
518
views
clangd doesn't respect include directories defined in .clangd
I recently switched from ctags to clangd for better lsp support in neovim. Now clangd doesn't recognize my local include directories.
I tried the following .clangd files without success (with the ...
2
votes
2
answers
1k
views
How to ignore unknown options in Clangd for files outside the project structure?
I have a CMake that targets Arduino. This involves some command line options to the compiler that clangd is not familiar with.
This would give me an error at the top of any file:
Unknown argument: '-...
5
votes
1
answer
242
views
add (constructor) arguments auto completion
I am using clangd in my C++ project.
When clangd suggests a function, it also inserts placeholders for the functions:
However, when I type a constructor, I only receive the overload window I can ...
3
votes
1
answer
143
views
Can C++ IDEs preview variadic argument types or names? [closed]
Is there any way to restore these nice IDE hints when forwarding variadic arguments?
The classic example is std::make_unique<>(...) where you suddenly have to start clicking around to find the ...
0
votes
1
answer
1k
views
Why does clangd not find all references?
How can I figure out why a reference can't be found by clangd? Can I list the index to understand if what I'm looking for is missing?
Clangd docs
clangd has this information (see https://clangd.llvm....
1
vote
2
answers
212
views
Discrepancy of `unsigned long` size between llvm and gcc in riscv32
I do not know if this is a bug or intended (I'm missing a flag). But in gcc unsigned long expands to uint32_t while in llvm it doesn't.
#include <stdint.h>
void test (uint32_t i);
void test (...
1
vote
0
answers
87
views
function overloading in C riscv64-elf-gcc vs clang
In an embedded riscv32 mcu's sdk I see the follow function overloading practice:
void FLASH_ROM_READ(uint32_t StartAddr, void *Buffer, uint32_t len);
void FLASH_ROM_READ(UINT32 StartAddr, PVOID ...
2
votes
1
answer
238
views
No language server found at path "". Language support for MPLAB projects will be unavailable
I am using the MPlab extension for VScode it has been working for very basic lines, but it always gives me this warning during startup. How do I fix this?
I have tried building more advanced projects ...
1
vote
1
answer
2k
views
Does Clangd 19.1.7 support C++ 20 modules?
I'm setting up a new project in C++ 23. I want to write it fully in modules. Setting up a project i wrote a simple program to check if everything is working well. Here it is:
main.cpp:
import math;
...
1
vote
1
answer
179
views
clangd disable inlay hints for BlockEnd is not working
My project level settings.json is like following:
"C_Cpp.intelliSenseEngine": "disabled",
"C_Cpp.formatting": "clangFormat",
"C_Cpp....
3
votes
1
answer
82
views
How to expand Macros of a huge project
Is there an easy way to get entire definition of ValueTy. It it diffcult to complile the single file with -E option.
llvm-projct part of Value.h code
/// Concrete subclass of this.
///
/// An ...
1
vote
0
answers
53
views
Clangd is parsing object instantiation as function declaration (not MVP ambiguity)
I have the following c++ code
struct Foo {
Foo(int x) {}
};
int main() {
int x = 42;
Foo f(x);
}
That I can compile and execute with clang++. However, if I open this code in Neovim, my LSP (...
1
vote
1
answer
86
views
Configure clangd to reflect implicit dependency graph
P.S. I struggled to find an appropriate title for this question...
I am faced with a challenge when using clangd with the CPython project:
In the annotated screenshot shown above, macro PyObject_HEAD ...
0
votes
1
answer
1k
views
Visual Studio Code Clangd only use clang-tidy for project. Problems with external include
I want to use clang-tidy in VsCode to establish a consistent coding style.
The project does not use Cmake and I am currently not feeding compiler-options to clang-tidy. I am running into problems ...
1
vote
1
answer
169
views
Wording a variadic concept to get clangd autocomplete
I have the following concept:
template<typename T, typename MsgType>
concept CanSend = requires(T obj)
{
{obj.send(std::declval<MsgType>())} -> std::same_as<void>;
};
template&...
1
vote
1
answer
998
views
How to set up clangd with kickstart.nvim
I followed these instructions:
https://github.com/nvim-lua/kickstart.nvim
https://youtu.be/m8C0Cq9Uv9o?feature=shared
I am using Windows with gcc. And I am using Microsoft Terminal (cmd) (available on ...
1
vote
0
answers
120
views
Clang forward slash in #include headers not reading the correct file location?
I have a header in one of my C++ projects that looks like this:
#include <QtCore/qglobal.h>
This references a header located in Qt/6.7.2/macos/lib/QtCore.framework/Headers. While qglobal.h ...
0
votes
0
answers
44
views
how to make clangd use my custom llvm installation?
I am using clangd from my custom llvm installation, however it still using the system include instead of my installation.
I also tried: export CPLUS_INCLUDE_PATH=/path/to/my/llvm/include
which does ...
1
vote
1
answer
401
views
clangd cannot find ue5 header files
I used UE5 to generate a C++ class and opened it with VSC. Clangd prompted that it could not find "coreminimal.h", but the project could be generated normally.
ue seems to automatically ...
0
votes
2
answers
701
views
clangd false positive '<quadmath.h>' not found
I have a C++ project, using CMake, GCC and Arch Linux. I am using GCC and the project is compiling correctly (both in IDE and command line), but I have these errors in Qt Creator:
...
0
votes
1
answer
216
views
clangd code completion in vscode gives incorrect tips when developing Qt application
I use VSCodium and gcc complier to develop c++ in linux, clangd server and clangd vscode plugin have been installed. My example code is shown below.
QByteArray bytearray;
configFile.open(QIODevice::...
0
votes
1
answer
377
views
VSCode and clangd don't parse C header files with different extension name
I'm working on a C project that, for some odd reason has many header files that are named with an extension of .inc instead of .h.
So, for example instead of calling a file header1.h it will be called ...
1
vote
0
answers
130
views
How to ignore errors in files for vscode plugin clang + cmake?
I used the clangd plugin of vscode with cmake to develop C language projects. The clangd plugin provides clang-tidy static detection function.
But I have a requirement: Can I ignore the errors in a ...
0
votes
0
answers
374
views
How can i make Neovim clangd LSP use Homebrew gcc
I have Apple clang, as well as homebrew gcc installed. In neovim, i have set up the clangd lsp, which works fine as it is, but when i try to use bits/stdc++.h library, i get linting errors everywhere.
...
0
votes
1
answer
227
views
clang unable to find libstdc++, but libc++ works
OS : ubuntu22.04
target : use LSP with clangd in neovim
problem : unable to find 'iostream'
, I have generated a complile_commands.json, but it didn't work too.
$ cat compile_commands.json
[
{
&...
2
votes
0
answers
451
views
bear in WSL2 but failed: wrapper: failed with: gRPC call failed: failed to connect to all addresses
Thank you for taking the time to look at my question!
Environment:
OS: WSL2 on Windows11, Ubuntu 22.04.3 LTS x86_64
Bear version: 3.0.18, Bear install method: apt
Description:
I am trying bear to ...
3
votes
1
answer
460
views
Add missing includes without path
I am using clangd with VSCode. Clangd offers the possibility to add missing includes. When doing so, it (sometimes? couldn´t figure out when) automatically adds the relative or absolute path to the ...
0
votes
1
answer
353
views
How to disable Preview popups from LSP server?
I use clangd as my LSP server and configure it with .clangd file. I don't use any additional LSP plugins. And every time I use the omnifunc on a function from any header except stdio.h and stdlib.h, ...
-1
votes
1
answer
1k
views
How to install rizsotto/bear on Windows? [closed]
Title says it all.
This bear (build ear)
The INSTALL.md doesnt say nothing about Windows
There is no "release" .exe
The CMAKE commands, on INSTALL.md dont work
0
votes
1
answer
1k
views
How to avoid clangd inserting function argument placeholders for `std::endl`
I'm new to neovim and I want to set it up for a c++ project. I'm using kickstart.nvim and have enabled clangd and added cpp to treesitter.
I'm having an issue where the LSP suggestion for std::endl is ...
2
votes
1
answer
696
views
Clangd is disabled at every launch by Qt Creator
Been using QtCreator for a few years, everything was great.
Recently I changed my main dev laptop, and now at every single startup I keep getting this message:
"The use of clangd for the C/C++ ...