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

Qt Creator very slow due to constant indexing with clangd

I use Qt Creator 7.0.2 for a mixed C/C+ project using CMake 3.20.6 (and Ninja as a generator) (and MinGW 7.30 64-bits as a main compiler), and it has been recently very slow due to constant indexing. It says almost at all times inthe bottom right…
Charles
  • 988
  • 1
  • 11
  • 28
1
vote
1 answer

Making Clangd work with Conan & Cmake (Clangd can't find headers outside project folder)

Problem description I am cross compiling with arm-none-eabi-g++ and I am using conan C/C++ binary package manager together with cmake build system. My project consists of C, C++ and ARM assembly files. And it uses our customer's headers which are…
71GA
  • 1,132
  • 6
  • 36
  • 69
1
vote
1 answer

How to use cuda with LSP-clangd

I want to use sublime text as my c++ editor. I added LSP-clangd in the editor. I generate some compile_commands.json and clangd works on almost every files in my project but not with cuda files. I saw in clangd FAQ that we must ensure : that our…
lufydad
  • 225
  • 2
  • 8
1
vote
0 answers

How to use Clangd LSP + COC in neovim for Different extension types of Cpp files *.cpp, *.cc *.x etc

For some reason, the project I am working on names some of it's Cpp header files as *.x It looks like these files are not being indexed by Clangd and I end up with the following error whenever I try to use references, definitions on objects declared…
raving_sage
  • 13
  • 1
  • 5
1
vote
2 answers

getting include paths to work with Neovim and LSP-zero/Clangd

I'm currently Studying Computer enginering and taking embeded systems class, My isuse is that we use a custom library then compile it in a old version of Codewarrior. how I would go about creating an include path for my lsp with nvim I was…
1
vote
1 answer

How to solve snap install permission denied on RHEL 7?

I was following this guide to install clangd. After installing snap smoothly, I tried to install clangd, but the following error occurred. $ sudo snap install clangd --classic error: cannot add authorization: open /[home directory]/.snap/auth.json:…
Heerae Lee
  • 11
  • 2
1
vote
0 answers

Increase/specify vscode+clangd parsing timeout

I use vscode with clangd extension. Clangd works really nice, but when I am editing the file, clangd starts parsing it almost right away, with minimum timeout. As a result it consumes lots of cpu and shows lots of errors for nothing, before I finish…
Avert
  • 435
  • 3
  • 17
1
vote
0 answers

How to make clangd recognize gcc header files under macOS

I'm trying to use vscode-clangd plugin to complete my code. I've tried to use--query-driver and other parameters. Neither of them can recognize g+++ 12's header file properly, but clions that are also clangd based can recognize gcc's header file…
Season0518
  • 11
  • 1
1
vote
1 answer

How to pass isystem flag to clangd in compile_commands.json?

I have an embedded C project, and want to read it in VSCode with clangd extension. I've built the project and generated compile_commands.json successfully with xmake/cmake. But clangd cannot find (cross compiler's) system headers using the generated…
Jackoo
  • 117
  • 1
  • 1
  • 12
1
vote
1 answer

VSCode - clangd extension does not format/lint on save

I am using VSCode with the clangd extension for C++ development (through Remote SSH extension). I have my .clang-format and .clang-tidy files with the rules I want to enforce. If I format the code manually (either Ctrl-Alt-F or right click -> Format…
antogilbert
  • 176
  • 2
  • 12
1
vote
0 answers

VSCode Clangd extension wrong function argument type annotation

For some reason, Clang is showing five x type annotations (lines 24 & 25) and I don't know why, shouldn't be just one? It is not so bad in this example, but it gets annoying with larger expressions. I want to know why is this happening
1
vote
1 answer

vscode + clangd extension: formatting ignores .clang-format file

In Visual Studio Code with the clang extension, when I try to format document, the formatting ignores the .clang-format file in the workspace (located 2 levels above the folder of the file I am trying to format). The result of the formatting looks…
Alex O
  • 1,429
  • 2
  • 13
  • 20
1
vote
0 answers

StreamMessageReader is not a constructor in Electron + Monaco app

I'm trying to build an application using Electron with Monaco editor. I used monaco language client to integrate the editor with clangd. But somehow it didn't work... After manually connecting to the LSP server through web socket, I get the…
1
vote
1 answer

clangd does not find `compile_commands.json` automatically

Setup I'm using clangd through neovim with nvim-lspconfig. require('lspconfig').clangd.setup { -- on_attach = keybinds.on_attach, cmd = { "clangd", "--background-index", "--suggest-missing-includes", --…
Olli
  • 375
  • 5
  • 15
1
vote
1 answer

How can I use `pkg-config` with clangd?

I have started writing a GTK App in C, and since I am using clangd as my language server, I want to configure it. The problem is, clangd won't listen when I pass this as my compiler flags: CompileFlags: Add: [ $(pkg-config --cflags gtk4) ], …
AggelosT
  • 108
  • 1
  • 9