Questions tagged [clangd]

clangd is a language server that implements the Language Server Protocol

clangd is a language server that implements the Language Server Protocol

156 questions
1
vote
1 answer

coc.nvim Server clangd failed to start: Error: spawn UNKNOWN issue -4094

so my issue is I installed neovim and nodejs and coc.nvim in windows I want to set it up for c++ and I did everything it asked but when I open cpp files I got an error message like : Server clangd failed to start: Error: spawn UNKNOWN here is the…
1
vote
1 answer

How to get lsp to work in Neovim for c++(clangd) and python?

I'm using LazyVim as a bootstrap config. On top of that I have very few changes. However, I'm not able to get lsp working for c++. LSP is working fine because it is working for Lua files. So, that leaves me suspecting my LSP config. The behavior is…
thumala manish
  • 198
  • 1
  • 10
1
vote
1 answer

Enable ClangdSwitchSourceHeader to work with separate source and header files

I'm trying to set up my Neovim/LSP/Clangd setup at work. We use two different ways to store source (.cpp). and header (.h) files. The first way is the common approach, where both the source and header files are placed in the same folder. The second…
Fanteria
  • 62
  • 1
  • 4
1
vote
0 answers

How to debug nvim-lspconfig neovim plugin?

I'm using the neovim plugin nvim-lspconfig setup with clangd server and a generated compile_commands.json file for C++ development. vim.lsp.buf.definition (go to definition) works most of the time, but does not work for some symbols. Any tips on…
1
vote
0 answers

Clangd constantly creates preamble (*.pch* files) files in the tmp folder and does not delete them! How to delete it automatically?

Access rights as a user (ie, create and delete allowed), reinstallation of clangd did not help! What can I do to make it start deleting these files by itself? I use and run clangd 13.0 in conjunction with lsp.
1
vote
1 answer

nvim + clangd | compile_commands.json with MetaProject

I am setting up nvim for my work project which is built using empty MetaProject that builds multiple sub-projects and I have issue with clangd. It doesn't recognize custom headers or classes. I know that compile_commands.json is needed for clang in…
Morph
  • 165
  • 2
  • 9
1
vote
0 answers

What can I do to use clangd in vscode to develop code about qemu?

Currently, I am using VS Code to write QEMU-related code. I use the clangd plugin, which requires the compile_command.json file. Although I generated this file with the appropriate command ninja -t compdb > compile_commands.jso, clangd still cannot…
董继斌
  • 11
  • 1
1
vote
0 answers

vscode clangd cannot index cuda header files outside of .cu files

I'd like to use vscode clangd to index CUDA header files in my project. However, it won't run correctly when I am not in .cu files, even the content of them are the same. I wonder if there is any way to make it run correctly? Thanks. clangd…
1
vote
1 answer

How can I make the VS Code clangd extension aware of the include paths defined in my CMake configuration?

I'm coding C++ on a Raspberry Pi 3B via VSCode's remote ssh. Currently, I just manually add all extra include directories (and other compiler settings) in settings.json: { "clangd.fallbackFlags": [ "-I/usr/include/foo", …
jiandingzhe
  • 1,881
  • 15
  • 35
1
vote
0 answers

Pipe LSP server over HTTP

I'm trying to pipe different LSP Servers over HTTP (to put it in docker and run in a more isolated way). But after some hours trying I stopped in a final error for my actual knowledge (and being here for my first post) At this point I'm trying run…
1
vote
1 answer

clangd doesn't find and finds the wrong when using arm-none-eabi-gcc

I'm using VS Code with the clangd plugin and it can't find . Clangd is able to parse all of the source files in my project without any problem. But certain header files are not found by clangd, and for other header files, clangd finds the…
Ryan Jensen
  • 207
  • 1
  • 9
1
vote
1 answer

clangd client: couldn't create connection to server

i'm trying to install clangd extension to coc plugin in vim when i run CocCommand clangd.install i got these errors : [coc.nvim] Server clangd failed to start: Error: Pending response rejected since connec [coc.nvim] clangd client: couldn't create…
1
vote
1 answer

How to add OS-specific complier flags in .clangd file?

I configured clangd using nvim-lspconfig. Now I would like to enable AVX support for certain projects in Linux. How can I detect OS type in .clangd file, and then add -mavx flag only when it is Linux? CompileFlags: Add: [-xavx]
chenzhongpu
  • 6,193
  • 8
  • 41
  • 79
1
vote
1 answer

VSCode clangd won't suggest types in STL

Clangd doesn't suggest while I'm typing like 'shared' (I want std::shared_ptr suggested), unless the corresponding headers are included. But in another project of mine, clangd works well. I notice that only types miss in the broken one, functions…
胡文浩
  • 13
  • 3
1
vote
1 answer

Make clangd suppress `undeclared_var_use` only for a specific variable

Imagine being a guest contributor opening a C project similar to the following example code, in an editor using clangd to lint the code: Makefile: all: $(CC) -c -o example.o example.c -DFOO=1 example.c: int foo = FOO; int bar = TYPO; With…
sampi
  • 576
  • 5
  • 15