为什么找不到lsp clangd linting fr Irror;
lsp linting clangd 抛出 linting 错误 当做一个包含 例如 #include
我已经安装了 mingw(通过 choco install)并将其添加到我的路径中 还尝试添加包含
在此处输入图像描述
与 LLVM 相同!
但是当我尝试使用 cmake 构建 hello world 程序时,它可以工作 正如预期的那样。
我还将compile_command.json复制到由cmake生成的根目录
我花了 2 天来解决这个问题,但仍然没有运气,
这是 linting 问题。 (lsp cland 窗口)
非常感谢任何帮助。
lsp linting clangd throws a linting error
when doing an include
e.g
#include <iostream> error bits/c++config.h file not found
I already installed mingw(via choco install) and added it to my path
also tried added the includes
enter image description here
same with LLVM!
but when I tried to build a hello world program using cmake it works
as expected.
I also copied the compile_command.json to my root generated by cmake
I been spending 2 days to solve this, but still no luck
here's the linting problem. (lsp clangd windows)
any help is greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最后,由于 lsp clangd 配置错误而发生包含错误
。啊。叹息..我修好了。我从一开始就做错了事。
无需添加标志来包含所有内容,例如 -I 已丢失的内容。 clangd 本身没有任何问题。问题出在您的 lsp 配置上。
我正在使用 windows,powershell,没有 wsl,nvim -> lunarvim 和 cmake
修复很简单,只需添加编译命令路径
在你的 clang lsp 配置上的 --query-driver
之后,一切都应该工作得很好并且顺利
the include errors occur because of wrong lsp clangd config
Finally. ah. sigh.. I fixed it. I'm doing things wrong from the start.
there's no need to add flags to include everything e.g -I that has been missing. There's nothing wrong on the clangd itself. The problem lies on your lsp config.
I'm using windows,powershell, no wsl, nvim -> lunarvim and cmake
the fix is simple you just need to add the compile command path
on your --query-driver on your clang lsp config
after that everything should work nice and smooth
由于错误的 lsp clangd 配置而发生包含错误
这是我解决问题的解决方案
这是您应该进入 --query-driver 的路径,
请记住,这取决于您的compile_command.json。
cmake 生成的compile_command.json
你的 --query-driver 应该与你的命令路径相同在您的compile_command.json
lsp clangd config
之后列出有关错误缺少的包含现在应该消失
错误消失
the include errors occur because of wrong lsp clangd config
here is my solution for solving the issue
here's the path that you should have into your --query-driver,
remember it depends on your compile_command.json.
compile_command.json generated by cmake
Your --query-driver should be the same as your command path listed on your compile_command.json
lsp clangd config
after that errors about missing includes should gone by now
errors gone