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
17
votes
5 answers

Is there "includePath" option in clangd?

I used to work with VSCode C/C++ extension. there was a feature in this extension(in a json file), called "includePath", which I could set the paths for my headers, so without execution of CMake or make, I would have the suggestion of my headers and…
AMIR REZA SADEQI
  • 409
  • 2
  • 5
  • 13
14
votes
3 answers

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 becoming very obtrusive to me. How can this be…
12
votes
1 answer

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/example.hh" int main() { return…
Phil
  • 131
  • 1
  • 4
8
votes
1 answer

Is there a way to specify the c++ standard of clangd without recompiling it?

I'm trying to use a feature in c++17(const lambdas) without having clangd error me. I've searched online and every answer tells me to recompile clangd with a flag. Is there truly no other way? Edit: Clangd is not the compiler. It's a language…
Aaron Liu
  • 361
  • 2
  • 13
8
votes
3 answers

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 to use GCC as my compiler, but still use the…
Thaddaeus Markle
  • 434
  • 1
  • 4
  • 12
7
votes
1 answer

Clion clangd, how to limit memory usage

clangd uses a lot of Memory (Up to 2.5Gig on my System). On my 8GIG System I frequently run into OOM situations. Currently the only solution I have found is to kill clangd once it uses a lot of memory. clangd has some commandline options that look…
arved
  • 4,401
  • 4
  • 30
  • 53
7
votes
2 answers

Clangd - how to set default flags to be used when there is no `compile_commands.json`?

This is probably not possible, but I still want to ask. I'm using Clangd as an autocompletion engine for VSCode. It works great, but there is one problem. The official Windows binaries of Clang rely on MSVC standard library headers. If MSVC is not…
HolyBlackCat
  • 78,603
  • 9
  • 131
  • 207
6
votes
2 answers

clangd doesn't recognize standard headers

This question has been asked and answered a bunch of times, but none of the answers seem to work for me. I've been trying to get clangd set up in nvim lsp. I used bear to generate compile_commands.json, but clangd still gives me errors telling me…
iHnR
  • 125
  • 7
6
votes
2 answers

How to configure clangd to find missing external header file?

I am a novice user of clang tools and I am learning c/c++. I have some code that is based on a framework that uses its data structure and build system ( OpenFOAM). I compiled the framework's libraries in a folder in home directory. This framework…
Ali
  • 366
  • 4
  • 11
6
votes
3 answers

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 comes to browsing the code by finding references,…
Petross404
  • 177
  • 1
  • 12
5
votes
1 answer

How to install clangd on Mac (preferably with Homebrew)

I have used brew install llvm, so older answers (and the clangd website) say that clangd should already be installed. But in the current version this seems to not be the case. clangd is not in my path and none of the folders I looked into have that…
4
votes
2 answers

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-generic", "file":…
lucky-star
  • 41
  • 1
  • 2
4
votes
0 answers

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 included file: 'memory' file not found [pp_file_not_found]. Too…
tcffm
  • 139
  • 2
  • 9
4
votes
3 answers

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 client. If I do something like if (CLIENT) { //…
Duddino
  • 53
  • 4
4
votes
1 answer

How to get clangd completer working with Unrealengine-4

So i have been trying to learn unrealengine4 and wanted to use vim as my editor. As an autocompletion engine i wanted to use CoC with clangd. After some fiddling around to get my compile_commands.json almost everything works as expected. But i get…
1
2 3
10 11