jmederosalvarado / roslyn.nvim

Roslyn LSP plugin for neovim
MIT License
192 stars 33 forks source link

Allow settings to be passed through to the language server #17

Closed ppebb closed 6 months ago

ppebb commented 7 months ago

Allows settings to be passed to roslyn via a settings key in the setup function such as

require("roslyn").setup({ -- Roslyn lsp specific setup because it's quirky and special
    dotnet_cmd = "dotnet",
    on_attach = on_attach,
    capabilities = client_capabilities(),
    settings = {
        ["csharp|completion"] = {
            ["dotnet_provide_regex_completions"] = true,
            ["dotnet_show_completion_items_from_unimported_namespaces"] = true,
            ["dotnet_show_name_completion_suggestions"] = true,
        },
        -- and so on
   }
})

I did nuke the examples you had commented out, but I was unsure where you would want to put them (readme, wiki?) or where you got them, as the list looked incomplete. I could also add defaults but I do not know what you would want those to be. Feedback would be appreciated so I can add those.

lvimuser commented 6 months ago

Looks good to me. I'm fine removing the settings comment from the code for now. I'll improve the README soon, and I'll make sure to include possible settings.

For reference, this seems to include the list of settings (see serverOption)

https://github.com/dotnet/vscode-csharp/blob/main/test/unitTests/configurationMiddleware.test.ts

default values: https://github.com/dotnet/vscode-csharp/blob/main/package.json#L1057-L1251

``` code_style.formatting.new_line.insert_final_newline csharp|background_analysis.dotnet_analyzer_diagnostics_scope csharp|background_analysis.dotnet_compiler_diagnostics_scope csharp|code_lens.dotnet_enable_references_code_lens csharp|code_lens.dotnet_enable_tests_code_lens csharp|code_style.formatting.indentation_and_spacing.indent_size csharp|code_style.formatting.indentation_and_spacing.indent_style csharp|code_style.formatting.indentation_and_spacing.tab_width csharp|code_style.formatting.new_line.end_of_line csharp|completion.dotnet_provide_regex_completions csharp|completion.dotnet_show_completion_items_from_unimported_namespaces csharp|completion.dotnet_show_name_completion_suggestions csharp|highlighting.dotnet_highlight_related_json_components csharp|highlighting.dotnet_highlight_related_regex_components csharp|implement_type.dotnet_insertion_behavior csharp|implement_type.dotnet_property_generation_behavior csharp|inlay_hints.csharp_enable_inlay_hints_for_implicit_object_creation csharp|inlay_hints.csharp_enable_inlay_hints_for_implicit_variable_types csharp|inlay_hints.csharp_enable_inlay_hints_for_lambda_parameter_types csharp|inlay_hints.csharp_enable_inlay_hints_for_types csharp|inlay_hints.dotnet_enable_inlay_hints_for_indexer_parameters csharp|inlay_hints.dotnet_enable_inlay_hints_for_literal_parameters csharp|inlay_hints.dotnet_enable_inlay_hints_for_object_creation_parameters csharp|inlay_hints.dotnet_enable_inlay_hints_for_other_parameters csharp|inlay_hints.dotnet_enable_inlay_hints_for_parameters csharp|inlay_hints.dotnet_suppress_inlay_hints_for_parameters_that_differ_only_by_suffix csharp|inlay_hints.dotnet_suppress_inlay_hints_for_parameters_that_match_argument_name csharp|inlay_hints.dotnet_suppress_inlay_hints_for_parameters_that_match_method_intent csharp|quick_info.dotnet_show_remarks_in_quick_info csharp|symbol_search.dotnet_search_reference_assemblies mystery_language|Highlighting.dotnet_highlight_related_json_components mystery_language|background_analysis.dotnet_analyzer_diagnostics_scope mystery_language|background_analysis.dotnet_compiler_diagnostics_scope mystery_language|code_lens.dotnet_enable_references_code_lens mystery_language|code_lens.dotnet_enable_tests_code_lens mystery_language|completion.dotnet_provide_regex_completions mystery_language|completion.dotnet_show_completion_items_from_unimported_namespaces mystery_language|completion.dotnet_show_name_completion_suggestions mystery_language|highlighting.dotnet_highlight_related_regex_components mystery_language|implement_type.dotnet_insertion_behavior mystery_language|implement_type.dotnet_property_generation_behavior mystery_language|quick_info.dotnet_show_remarks_in_quick_info mystery_language|symbol_search.dotnet_search_reference_assemblies navigation.dotnet_navigate_to_decompiled_sources text_editor.tab_width ```