Closed GopherJ closed 2 months ago
I encountered a clangd issue: https://github.com/clangd/clangd/issues/1142, so I tried to create ~/.clangd file with the following content:
CompileFlags:
Add: -Wno-unknown-warning-option
Remove: [-m*, -f*, -forward-unknown-to-host-compiler, --generate-code*]
Diagnostics:
Suppress: [drv_unknown_argument,drv_unsupported_opt]
but it didn't fix the issue
The .clangd
configuration file should be located in project root https://clangd.llvm.org/config.html#files.
You can use :CocCommand clangd.projectConfig
to open it.
@fannheyward I used this command to create this config file but it wasn't working yet, I still have the error
The .clangd
file is in the project root, not your $HOME directory.
@fannheyward I used your command so it's not in $HOME directory, specifically it's in dotfiles root directory, I tried to copy to cmake directory as well
@fannheyward FYI, I think coc-setting's diagnostic = false still works. Though I don't think it uses .clangd
@fannheyward I tried to configure:
"clangd.arguments": ["--enable-config"],
but it doesn't work either, anything specific to my version of clangd? I use clangd-15
specifically it's in dotfiles root directory
Why? The :CocCommand clangd.projectConfig
command should open the .clangd
file in your project root, never in any other locations.
coc-clangd provides this command only used to create or open the configuration file, clangd will search and use it, coc-clangd won't use it.
Check the https://clangd.llvm.org/config.html#files docs.
@fannheyward I don't understand, the command works and it's in correct location but as I said it doesn't have any effect
No matter if you edit the config or not, it just didn't take effect. I don't know if I misconfigured anything or not, but I really dont have any custom config
I say dotfiles is because it's the project root of my test cmake project.
dotfiles/
where's the .clangd
file? Under dotfiles
or in cmake
folder?
Please describe the problem. For hints on what information is helpful, see: https://clangd.llvm.org/troubleshooting.html
Logs
System information Clangd version (from the log, or
clangd --version
): 15.0.7 clangd extension version (from:CocInfo
): 0.30.2 Operating system: x86_64-pc-linux-gnu