Configuring Clangd linting
I am currently learning C++ but dont know how to configure clangd to not display these errors as I think it is trying to lint a newer C++ standard. The program compiles and runs fine so the erroneous linting is off-putting.
Hope this is the appropriate channel to ask for help. Have a nice day!
Are you using my neovim config? I'm away from the computer but those warnings look strange.
Are you using my neovim config? I'm away from the computer but those warnings look strange.
Yeah, followed the github 1:1 and double checked it. Im stumped, im new to nvchad and modding nvim in general.
So i think you are not going to like this answer or maybe you will. This had me scratching my head because i think i did the exact same thing you did without thinking. for fun using "shift + ;" to bring up the ":" do this
:echo &filetype
or
:set filetype?
if they come back as C then that is your issue. You have probably saved your file as .c not .cpp. at least that is what i just did not even thinking.
So i think you are not going to like this answer or maybe you will. This had me scratching my head because i think i did the exact same thing you did without thinking. for fun using "shift + ;" to bring up the ":" do this
:echo &filetypeor
:set filetype?if they come back as C then that is your issue. You have probably saved your file as .c not .cpp. at least that is what i just did not even thinking.
Thanks for replying, the commands you provided return cpp. Maybe its a clangd config issue? It might be trying to lint for a newer C++ standard but I have no idea how to configure clangd to use another standard. Ive never written C++ before so my observations may be off. Again thanks for the reply))
do you have a .clangd file? or something that is configuring clangd? maybe something is setup for c. Because when my was a .c file i had the exact same messages as you do.
:LspInfo
does that say this?
- Detected filetype: cpp
I copied my entire .config/nvim .local/share/nvim and .local/state/nvim directories to another machine, and have no errors. Ill have a proper look today when I am back on the desktop but atleast that narrows it down to maybe the clangd version??? or some other config files and is not necessarily an issue in your nvchad config repo! Both machines are running arch, and have all the dependencies for nvchad and such.
Before you do that please check what i said above about :LspInfo I really think that even though nvim may know it's a cpp that clangd thinks it's a c file. So that should tell. you. And and you absolutely sure you don't have a hidden .clangd file that is setting the target to say std=c99 or something.
Before you do that please check what i said above about :LspInfo I really think that even though nvim may know it's a cpp that clangd thinks it's a c file. So that should tell. you. And and you absolutely sure you don't have a hidden .clangd file that is setting the target to say std=c99 or something.
Will do!