nixvim
nixvim copied to clipboard
[BUG] plugins/lsp omnisharp settings use incorrect case/structure
| Field | Description |
|---|---|
| Plugin | lsp |
| Nixpkgs | unstable |
| Home Manager | unstable |
Description
The omnisharp lsp server expects options to be directly set using snake_case_lower, yet we provide them as a nested settings table using camelCase.
Minimal, Reproducible Example (MRE)
programs.nixvim = {
plugins.lsp {
enable = true;
servers.omnisharp = {
enable = true;
settings.enableRoslynAnalyzers = true;
};
};
}
I'm pretty keen to contribute and fix this myself, just wondering if someone could point me in the right direction to idiomatically map props from settings.enableRoslynAnalyers -> enable_roslyn_analyzers
Are you sure this is repercuted in the init.lua? Most plugins have a mapping from camelCase to snake_case
@traxys
Here is the contents of options (using print(vim.inspect(server.extraOptions))) before the call to require('lspconfig')[server.name].setup(options)
{
cmd = { "/nix/store/zpvg8d9zwwxj6g344cdqv3grpldcxvxz-omnisharp-roslyn-1.39.11/bin/OmniSharp" },
settings = {
omnisharp = {
enableEditorConfigSupport = true,
enableImportCompletion = true,
enableMsBuildLoadProjectsOnDemand = true,
enableRoslynAnalyzers = true,
organizeImportsOnFormat = true,
sdkIncludePrereleases = false
}
}
}
For anyone stumbling across this looking for a dirty hack/workaround and a way to get omnisharp_extended working, see below:
omnisharp = {
enable = true;
extraOptions = {
enable_rosyln_analyzers = true;
enable_import_completion = true;
organize_imports_on_format = true;
enable_editorconfig_support = true;
analyze_open_documents_only = true;
handlers."textDocument/definition".__raw =
#lua
"require('omnisharp_extended').handler";
};
};
I'm pretty keen to contribute and fix this myself, just wondering if someone could point me in the right direction to idiomatically map props from
settings.enableRoslynAnalyers->enable_roslyn_analyzers
There is already a converter in helpers.toSnakeCase, although mapping over the keys will be a little more involved.