Блог пользователя kunzaZa183

Автор kunzaZa183, история, 5 часов назад, По-английски

Hi everyone,

I'm a big fan of Visual Studio Code. However, I'm not a big fan of the C/C++ intellisense provided by Microsoft. Although I am aware it works on other machines; on my machine, it is a slow and buggy extension that seems to hallucinate more often than not, which led me to switch to clangd as my primary C/C++ autocomplete extension. I've been using clangd for quite a while and I like it. One annoying thing I want to fix though, is the lack of inclusion of headers that are provided by GCC.

Headers like bits/stdc++.h, ext/pb_ds aren't supported by clang, but I would like to know how I could be able to use these headers with clangd on vscode. I remember that during IOI2024, the clangd extension provided by the host allowed me to use these headers, so I know that it is possible.

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
5 часов назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by kunzaZa183 (previous revision, new revision, compare).

»
3 часа назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I did someting similar for my non vscode setup. My understanding is that clangd uses a clang/clang++ binary to parse and understand code. After you find that binary you can try "/your/clang/location/clang++ -v foo.cpp" to figure out the exact include paths of clang++. Once you find those paths you should manually add the headers you want to use.