Skip to content

Setting options in csharp.setup() is broken #25

@raine

Description

@raine

This works:

require("csharp").setup()

But as soon as you try to set options:

require("csharp").setup({
	lsp = {
		omnisharp = {
			analyze_open_documents_only = false,
			cmd_path = "",
			debug = false,
			default_timeout = 1000,
			enable = true,
			enable_analyzers_support = true,
			enable_editor_config_support = true,
			enable_import_completion = true,
			enable_package_auto_restore = true,
			include_prerelease_sdks = true,
			load_projects_on_demand = false,
			organize_imports = true,
		},
		capabilities = capabilities,
		on_attach = on_attach,
		roslyn = {
			enable = false,
			cmd_path = "",
		},
	},
})

the plugin stops working. By stops working I mean that LSP diagnostics stop showing where they should be showing.

You have some kind of bug in this logic

local deprecated_omnisharp_keys = {
"enable",
"enable_editor_config_support",
"organize_imports",
"load_projects_on_demand",
"enable_analyzers_support",
"enable_import_completion",
"include_prerelease_sdks",
"analyze_open_documents_only",
"default_timeout",
"enable_package_auto_restore",
"debug",
}
for index, key in ipairs(deprecated_omnisharp_keys) do
if merged_config.lsp.omnisharp[key] ~= nil then
merged_config.lsp.omnisharp[key] = nil
end
end
because removing it fixes the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions