262 questions
2
votes
1
answer
4k
views
How to include path using an eviornment variable in compile_flags.txt?
I am compiling with clang and editing with Visual Studio Code using the clangd extension on Windows. Compilation is fine, my issue is with intellisense.
I am using a compile_flags.txt that looks like ...
2
votes
1
answer
4k
views
Update VSCode to C++20
I am trying to use Visual Studio Code with C++20 with clangd.
Unfortunately it seems to be running in C++98.
I get the following error when using basic things like std::function
I have updated as ...
1
vote
2
answers
2k
views
why does lsp clangd linting throws an error "bits/c++config.h file not found?
lsp linting clangd throws a linting error
when doing an include
e.g
#include <iostream> error bits/c++config.h file not found
I already installed mingw(via choco install) and added it to my ...
7
votes
1
answer
13k
views
.clangd: use different compiler flags depending on file extension
I am using the .clangd configuration file to pass compilation flags to clangd.
I run clangd on a codebase with C and C++ files.
How can I have some flags apply to C++ files but not C files ?
27
votes
4
answers
22k
views
VSCode + Clangd: type annotations become obtrusive - how to disable?
I'm using VSCode 1.65.0, the clangd extension, and clangd from latest LLVM (14.0).
It seems to have introduced a feature where it displays type-hints whenever I use auto. Here is an example:
This is ...
0
votes
0
answers
874
views
abnormal behaviour of neovim with lsp clangd
this is my code that print hello world
now if i use command Format that call vim.cmd [[ command! Format execute 'lua vim.lsp.buf.formatting()' ]]
my code will becames like this now strange symbols ...
0
votes
1
answer
695
views
clangd language server gives weird errors. code compiles
I've got platformio project that compiles and works.
Using emacs + lsp-mode + clang.
One of the weird errors I get is for structures like this:
#include <queue>
#include <vector>
struct ...
5
votes
2
answers
7k
views
Can not use clangd to read linux kernel code
I have some codes about Linux kernel driver. I use bear make to generate compile_commands.json.
this is some of my compile_commands.json:
"directory": "/usr/src/linux-headers-5.4.0-90-...
2
votes
0
answers
1k
views
SDL2/SDL.h not found, clang(pp_file_not_found)
I don't understand where I'm making a mistake.
My steps:
Installing vscodium, msys2. Updating msys2 packages, installing clangd extension, CodeLLdb.
Checking compilation build, work.everything works....
0
votes
1
answer
11k
views
Failed to install clangd language server in VS Code
I'm using VS Code and my workspace is on a remote Linux server. I successfully installed clangd extension on the remote server, however, when I tried to download the language server, I get the ...
0
votes
0
answers
571
views
Why there is no indentation when I use clangd in vscode?
when I type if and use clangd code completion, I got this.
if (condition) {
statements
}
I'm expecting
if (condition) {
statements
}
It's the same thing for while and for.
clangd-12 --version
...
3
votes
2
answers
5k
views
clangd for vscode with multiple build directories
I am trying to use clangd for code completion within vscode. I am using CMake for the project setup and I am creating a compilation database. However, I have several build directories with different ...
5
votes
1
answer
2k
views
How to use clangd text-highlighting with CUDA on header files
I'm running VSCodium with the clangd extension, and I'd like to have proper CUDA highlighting (e.g. __device__ and __host__ keywords are understood). I ran CMake to generate the compile_commands.json ...
1
vote
1
answer
395
views
coc-clangd has issues with gtkmm-4.0
I have the hello world program from the gtkmm documentation. I can compile the program without any issues using:
g++ -o example main.cc example.cc `pkg-config "gtkmm-4.0" --cflags --libs`
...
4
votes
0
answers
439
views
clangd LSP server not recognizing 'memory' file
I'm working on a c++ project and use the clangd LSP server in Spacemacs. The first line of the file I'm working on says #include "somefile.hpp"
The lsp server gives the error message
In ...
8
votes
3
answers
7k
views
Make clangd aware of macros given from the compiler
I have two executables that are build from the same source (a client and a server) and they're built with the compile options -D CLIENT=0 -D SERVER=1 for the server and -D CLIENT=1 -D SERVER=0 for the ...
1
vote
1
answer
1k
views
CLion: Clangd not found
I had to set up the executable in CLion today. Now the autocorrect is not working anymore and I'm receveibing the error message:
Clangd is not found at D:\Programme\CLion\CIDR\clion\bin\clang\win\...
2
votes
0
answers
207
views
How to manually request the clangd or implement ClangdServer for code complettion
I've installed clangd for MS VS Code and everything works fine.
I wonder how can I manually request clangd via language server protocol?
Or is there capability to programmatically include ClangdServer ...
6
votes
3
answers
13k
views
Vim warning: Looks like you've configured clangd in coc-settings.json, you should remove it to use coc-clangd
I 've recently started to code on Vim and while it's not easy, it's worth it. I am struggling to figure out basic things that I had for granted in an IDE like KDevelop or VSCode especially when it ...
3
votes
1
answer
3k
views
How to manually(without keybindings) search a symbol in a source code using coc-clangd/coc-nvim?
I use neovim and coc-clangd for C/C++ programming. Every thing is ok and i can jump through definitions and search references of a symbol in all of my project files by holding the cursor on the symbol ...
0
votes
0
answers
399
views
How do I set up clangd for Netbeans 12.1
How do I set up clangd for netbeans 12.1 because I cannot find anything online about setup with netbeans
2
votes
1
answer
510
views
Strange clangd crash when using \n instead of endl with -std=c++2a
This is the reference source file
#include <iostream>
int main() {
int x = 7;
std::cout << x << '\n';
}
If I open a line before the line with cout and write std:: I ...
1
vote
0
answers
1k
views
How does `clangd` know where a function definition is when only one file has been indexed?
How does clangd know where a function definition is when only one file has been indexed through the LSP (Language Server Protocol) message textDocument/didOpen?
This question is based off of the ...
12
votes
1
answer
7k
views
VSCode clangd extension can not find header file
My current file structure is:
├── common
│ └── example.cc
├── compile_commands.json
├── include
└── common
└── example.hh
example.hh: Leave it blank
example.cc:
#include "common/...
15
votes
3
answers
23k
views
Can I use GCC compiler AND Clangd Language Server?
I am working on a project that uses a GCC library (SFML), which is not available for clang, as far as I know. I am using COC with vim for code completions, but for C++ it needs clangd. Is there a way ...