Closed embeddedpenguin closed 2 years ago
Hello! Hmm I'm not too familiar with
clangd
. Have you read the this part and this part of their troubleshooting guide?
Yeah I've been through that a bunch of times. What I'm trying to say in this bug report is that the clangd binary that nvim-lsp-installer downloads and uses doesn't properly use the --query-driver=... argument I'm passing in. I know for a fact it's getting those arguments. It just isn't fetching the headers properly for some reason. This might just be the binary itself having a bug that is causing this. I don't know. I'm only reporting it here so that just in case other people face the same issue, they know why.
I've already confirmed that the clangd on my machine properly fetches the headers. The clangd nvim-lsp-installer provides does not fetch the headers properly.
I've yet to find a reason this would be lsp-installers fault, so I'm going to close this and create an issue over at clang.
Problem description
If I use the clangd provided by lsp-installer, very specific command line arguments do not work.
The command is the following, but the only important parts are --query-driver=... and --compile-commands=...:
clangd --query-driver=/usr/bin/arm-none-eabi-gcc --compile-commands-dir=/storage/Shared/Projects/Embedded-Graphics-Learning/software/firmware/oracle_same54n19a/gcc --pch-storage=memory --background-index -j=4 --header-insertion-decorators=0 --log=verbose
For some reason clangd wasn't seeing the headers associated with my toolchain, so things like stdio.h, stdlib.h, etc.... were being red squiggled and marked as being not found. It didn't do this for me in emacs so I went to
~/.local/share/nvim/lsp_servers/clangd/clangd/bin/
and removed the clangd that was there and sure enough clangd could see my headers again. My guess is it has something to do with the binary clangd being downloaded. I have no way of testing this though. The clangd on my machine is the same version as the one being downloaded by the lsp server installer.Here's when the clangd provided by lsp-installer was used, aka I didn't rename it to something so nvim wouldn't see it:
Here's when the clangd on my machine was used rather than the one provided by lsp-installer:
I realize there's not a lot going on in the second picture, but trust me it works now lol
I realize this may end up being difficult to reproduce, so if you need me to test some stuff let me know. I also don't know whose "fault" this is. It could be a permissions thing, or it could be the binary provided by llvm, or it could be nvim-lsp-config running things the wrong way. I have no idea.
Neovim version (>= 0.6)
NVIM v0.6.1 Build type: Gentoo LuaJIT 2.0.5
Operating system/version
Linux 5.15.16-gentoo-x86_64
I've recently downloaded the latest plugin version of both nvim-lsp-installer and nvim-lspconfig
Affected language servers
clangd
Steps to reproduce
Actual behavior
Expected behavior
LspInfo
clangd version from my machine (WORKING):
clangd version from lsp-installer (NOT WORKING with --query-driver):