Help with clang lsp #912
Unanswered
NorseManGef
asked this question in
Q&A
Replies: 3 comments 4 replies
-
you need a compile_commands.json, in your case, you need to use bear to generate the file |
Beta Was this translation helpful? Give feedback.
2 replies
-
I got it to work mostly. However, I don't know how to get clangd to pay attention to my .inc files. It seems to read their includes, but that's it. Nvim's parser is also not reading it as c++.
…-------- Original Message --------
On 5/20/25 02:48, Ching Pei Yang wrote:
you might need to do a clean build, I'm not really sure
check their wiki otherwise https://github.com/rizsotto/Bear/wiki
I should note that meson and cmake have their own ways of generating the file
—
Reply to this email directly, [view it on GitHub](#912 (reply in thread)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/A6XHR4TDWIXXHJGKE7N6X3327LT6FAVCNFSM6AAAAAB5PJYBR6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGMRQGQYDMNY).
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
How would I delcare that in nvf?
…-------- Original Message --------
On 5/20/25 05:52, Ching Pei Yang wrote:
not sure what a .inc file is, but nvim is probably detecting it as a different filetype. Try running :set filetype=cpp while in your .inc file and see if that works
if it does, you'll have to add rules to detect .inc files as cpp files. how exactly to do that I forgot, but :help ftdetect might say something
—
Reply to this email directly, [view it on GitHub](#912 (reply in thread)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/A6XHR4UIEBREYFX6BMR4PYT27MJQBAVCNFSM6AAAAAB5PJYBR6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGMRQGYYDAMQ).
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Microsoft is shoving copilot in my face on vscode, so I'm moving to nvim. However, I can't seem to get clangd to work right. Firstly, I can't figure out how to get clangd to activate on .inc files (I imagine this is done via lsp.opts but I can't find the documentation, if it exists). Secondly, I'm having issues with clangd not detecting some of my header files, and various other things.
For example: I have my test.cpp file in
projectdir/Vector/src folder
, and doctest.h inprojectdir/common/Include/doctest/doctest.h
, test.cpp includes doctest.h with the line#include "doctest/doctest.h"
, and it compiles just fine, but clangd reports an error. Interestingly, I have another header file inprojectdir/common/Include/gravedata.h
which is detected by clangd, and it's included via#include "gravedata.h
Despite gravedata.h being detected by the lsp, when I try to call functions under that header file's namespace, clangd claims that namespace, in this case "ian," is an undeclared identifier... it isn't according to vscode, and it compiles and runs just fine.
Sorry for the wordy question, I just have no idea what the problem is, nor how to solve it, and so I'm describing the situation in hopes someone here knows what's causing this.
Edit: I should note that I'm compiling via a makefile in
projectdir/Vector/
Beta Was this translation helpful? Give feedback.
All reactions