Closed srinathava closed 2 months ago
The problem is that for .neoconf.json
the settings are specified as lspconfig[servername][key] = value
, whereas in .vscode/settings.json
they are in a form of [namespace][key]
(not always, but most of the time).
The namespace can be the same as the server name (e.g. eslint
, clangd
), but not always (typescript.
for tsserver).
The config options with namespaces are defined in language servers schemas (listed at the bottom of neoconf readme).
Vscode passes these these directly to settings
field of the nameserver. (E.g. settings.clangd.restartAfterCrash
).
If you define them in .neoconf.json
, they will be passed as settings.restartAfterCrash
because neoconf will treat clangd
as server name and not part of the config option name.
For servers where the server name is the same as the namespace name, you can change this line in neoconf
- options.import.vscode and Settings.get_local(root_dir):get("vscode") or {},
+ options.import.vscode and Settings.get_local(root_dir):get("vscode." .. config.name) or {},
The problem arises for the stuff like tsserver. For some reason, neither tsserver, nor eslint ls want to accept settings
options in a form of { settings = { eslint = { nodePath = "foo" } } }
, even though this is what schema says.
@folke , do you know why this is happening? Apparently, the same servers accept it in vscode, but not in neovim via lspconfig. I am not sure where the problem lies exactly. I thought it was neoconf, but it may be lspconfig or neovim, or the servers themselves.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.
Did you check docs and existing issues?
Neovim version (nvim -v)
0.9.1
Operating system/version
Ubuntu 20.04
Describe the bug
I'm trying to use neoconf to pick up the custom clangd settings from our company provided
.vscode/settings.json
file at the root of our project directory.I see that
Neoconf show
does show the customclangd
settings. I see something like this:However
Neoconf lsp
just shows an empty directory:I verified that
neoconf
is sourced beforelspconfig
by putting print statements.Steps To Reproduce
Create a directory (say
/tmp/repro
)Create a file
/tmp/repro/init.lua
with contents as shown in the minimal repro box belowCreate a file
.vscode/settings.json
with contents below:You'll need to manually copy over a working
clangd
into thetools
subdirectory.Now open neovim by doing
Expected Behavior
When the C++ file is opened,
LspInfo
should show the path to the clangd in thetools
subdirectory. However, it will probably error out.Repro