You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@VonHeikemen I had the same issue as @bartekprtc in #167 and I solved it with the force_setup = true
But, when I try to manually provide the clangd cmd, it always breaks the client with: client [n] quit with code 1 and signal 15
This is my configuration:
return {
force_setup=true,
on_attach=function()
locallspconfig=require('lspconfig')
locallsp_util=require("lspconfig.util")
-- Unix-like check using 'test -e' command-- I mostly use Neovim from a bash-like shell always, so there's no need for Windows specific codelocalclangd_exec=globals.sys.is_windowsand'clangd.exe' or'clangd'localmbuilt_clangd=vim.fn.expand("~/code/own/llvm-project/build/bin/" ..clangd_exec)
localcmd='[ -e "' ..mbuilt_clangd..'" ] && echo found'localresult=io.popen(cmd):read("*a")
localmbuilt_clangd_exists=result:find("found") ~=nillocalclangd_path=mbuilt_clangd_existsandmbuilt_clangdorclangd_execlspconfig.clangd.setup({
keys= {
{ "<leader>cR", "<cmd>ClangdSwitchSourceHeader<cr>", desc="Switch Source/Header (C/C++)" },
},
root_dir=function(fname)
returnlsp_util.root_pattern(
"compile_commands.json",
"compile_flags.txt",
"Makefile",
"configure.ac",
"configure.in",
"config.h.in",
"meson.build",
"meson_options.txt",
"build.ninja"
)(fname) orlsp_util.find_git_ancestor(fname)
end,
ft=consts.lsp.clangd_fts,
capabilities= {
offsetEncoding= { "utf-16" },
},
cmd= {
clangd_path,
-- '--query-driver="C:/msys64/clang64/bin/clang-*"',-- "--all-scopes-completion",-- "--background-index",-- "--clang-tidy",-- "--compile_args_from=filesystem",-- "--completion-style=detailed",-- '--enable-config',-- "--function-arg-placeholders",-- "--fallback-style=llvm",-- "--header-insertion=iwyu",-- "--log=verbose",-- "--pch-storage=memory",-- "--suggest-missing-includes",-- "--pretty",
},
init_options= {
usePlaceholders=true,
completeUnimported=true,
clangdFileStatus=true,
},
})
end,
}
I tried without any args, as you see them commented out. No changes.
And the root dir and cmd args are exactly the same as if I don't pass the on_attach fn and I stick only with the defaults and force_setup = true.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
@VonHeikemen I had the same issue as @bartekprtc in #167 and I solved it with the
force_setup
= trueBut, when I try to manually provide the clangd cmd, it always breaks the client with:
client [n] quit with code 1 and signal 15
This is my configuration:
I tried without any args, as you see them commented out. No changes.
And the
root
dir andcmd
args are exactly the same as if I don't pass theon_attach
fn and I stick only with the defaults andforce_setup = true
.Can I have some help for this?
Beta Was this translation helpful? Give feedback.
All reactions