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
2
votes
2 answers

How to make clangd to enable header-only library implementation

There is a way of distributing C/C++ libraries as a one header-only file. Library is in one library.h file: header declarations together with implementation hidden under #ifdef LIBRARY_IMPL. You need to create some .c/.cpp file that does #define…
smokku
  • 1,256
  • 13
  • 22
2
votes
0 answers

neovim + lsp/clangd based autocompletion on Raspberry Pi 4

I am trying to configure a RPi4-based programming environment for embedded systems programming. I chose neovim as a primary editor due to ability to work with both "desktop" (with monitor and keyboard attached) and headless (remote, with ssh…
2
votes
1 answer

Is it possible to override or augment neovim's LSP configuration via a workspace config file?

I am using Neovim for C++ development (currently AstroNvim, and previously used LazyVim), and like it a lot. Usually I do not have any issues with the defaults for nvim-lspconfig and mason - the standard clangd server downloaded by mason from the…
Todor Todorov
  • 109
  • 1
  • 9
2
votes
0 answers

Why is clang-tidy in clangd so much faster than (run-)clang-tidy itself?

I have a fairly large project with lots & large headers that are included. Running clang-tidy on a single source file takes 10+ minutes. In contrast to that clang-tidy findings in clangd show up almost immediately. I expect clangd to be faster due…
pJunger
  • 41
  • 6
2
votes
0 answers

RapidJSON and clang-tidy and thread_local

I am working on a C++17-project which I am compiling under Linux with GCC 9. However, I EDIT the project under Windows 11 in QT Creator 10 using clangd/clangTidy(16.0.0). Now, when it comes to code that uses thread_local, I get errors in clang-tidy,…
SoulfreezerXP
  • 459
  • 1
  • 5
  • 19
2
votes
1 answer

How can I disable parameter auto-completion when selecting a suggested function in VS Code with the clangd extension?

When typing the prefix of a function name in VS Code, the IDE will provide suggestions to choose from. When using the clangd extension, if the suggestion is a function and the user selects it using the Tab key, VS Code will automatically complete…
2
votes
1 answer

Spurrious clang empty-translation-unit warning

This question has been asked before, but it seems none of the answers apply to my files. I'm using clangd 15.0.7 in VSCode on Windows 11 and macOS 13.2. Please note that gcc 11.3.0, the actual compiler for this project, doesn't emit any warnings.…
ice-wind
  • 690
  • 4
  • 20
2
votes
1 answer

Why does clangd report errors that are not there when compiling?

I have a compile_commands.json that reads [ { "directory": ".", "command": "clang++ -I/usr/local/include -I/usr/local/opt/libomp/include -std=c++2a -MT release/source.o -MMD -MP -MF release/source.d Wall -O3 -fopenmp -flto -DNDEBUG -c -o…
Bubaya
  • 615
  • 3
  • 13
2
votes
0 answers

Setting up clangd properly in VS Code

I have a C++ project consisting of multiple source and header files, and a Makefile to steer the build process. Building is done using clang++. Because I am not satisfied with the performance of the native C/C++ extension of VS code (although the…
Bubaya
  • 615
  • 3
  • 13
2
votes
1 answer

Visual Studio Code C Intellisense doesn't show functions description/documentation on macOS (Using Either C/C++ Intellisense or Clangd)

I've been having this issue with vscode on my mac where when I hover or call system functions it doesn't show their description, it just shows the arguments with no explanation whatsoever. I tried using the MS C/Cpp extension and its default…
meshal
  • 33
  • 6
2
votes
1 answer

clangd-14 cannot find c++ headers

How can I make clangd find c++ libs? Here is a simple example, given this cpp main file // main.cpp #include int main() { return 0; } I am generating the compile_commands.json db using bear: $ bear -- g++ main.cpp This gives the…
Mihai
  • 972
  • 2
  • 13
  • 35
2
votes
0 answers

Neovim dap C++ clangd

I'm having trouble configuring dap in NeoVim - after executing :lua require’dap’.continue() I get this error: Path to executable: /home/user/Projects/C++/app/E5108: Error executing lua…
2
votes
0 answers

clang-format: Insert new line between braces

Are there any ways to achieve this (the dot indicates the position of the cursor) in Visual Studio Code by using clangd formatter void foo() { . } instead of this void foo() { .} or are there any ways to just use the c/c++ extension formatter…
Colors
  • 21
  • 1
2
votes
1 answer

How to start clangd via web socket

I wanted to integrate Clangd with Monaco Editor and while trying to achieve this I found that I can't start Clangd via Web Sockets. When I run clangd in my terminal, it outputs Starting LSP over stdin/stdout, is there a way to let it launch a web…
2
votes
1 answer

How to get clangd to fallack to c++20

When there is no other information, how can I get clangd to fallback to c++20? eg, before the first build and cmake can generate one. This is on Arch Linux with a recent LLVM. This is run though the Emacs LSP, but that shouldn't make a difference.
JasonN
  • 1,339
  • 1
  • 15
  • 27
1 2
3
10 11