sublimelsp / LSP

Client implementation of the Language Server Protocol for Sublime Text
https://lsp.sublimetext.io/
MIT License
1.65k stars 183 forks source link

Support settings sections with | operator #2560

Open captain0xff opened 3 hours ago

captain0xff commented 3 hours ago

The roslyn lsp server (https://github.com/dotnet/roslyn) uses the | symbol to separate settings levels (like csharp|completion.dotnet_show_completion_items_from_unimported_namespaces). The sublime lsp client doesn't seem to support this. It will be nice if we can have a customizable approach here so that new operators can be easily added.

rwols commented 2 hours ago

I think this should be doable with ST's score_selector.

jwortmann commented 58 minutes ago

Could you explain what in particular is not supported?

I don't think there is anything needed to be done here. This syntax seems to be used for the section names in workspace/configuration. We are able to split on dots if the requested section is a sub-path https://github.com/sublimelsp/LSP/blob/9be040dfc9d6bad3a7d4bb7c41f94f74ac4f0003/plugin/core/collections.py#L45 but in general the section names can be arbitrary strings.

So you should be able to just put those setting names into your config:

{
  "clients": {
    "roslyn": {
      // ...
      "settings": {
        "csharp|completion.dotnet_show_completion_items_from_unimported_namespaces": true,
        "csharp|symbol_search.dotnet_search_reference_assemblies": "somevalue",
        // ...
      }
    }
  }
}
jwortmann commented 54 minutes ago

From your logs provided in the other issue I can see that you already specified one setting with value "fullSolution" and it gets successfully returned in the response:

:: [01:50:04.474] <-- CSharp workspace/configuration (3): {'items': [{'section': 'csharp|symbol_search.dotnet_search_reference_assemblies'}, {'section': 'visual_basic|symbol_search.dotnet_search_reference_assemblies'}, {'section': 'csharp|type_members.dotnet_member_insertion_location'}, {'section': 'visual_basic|type_members.dotnet_member_insertion_location'}, {'section': 'csharp|type_members.dotnet_property_generation_behavior'}, {'section': 'visual_basic|type_members.dotnet_property_generation_behavior'}, {'section': 'csharp|completion.dotnet_show_name_completion_suggestions'}, {'section': 'visual_basic|completion.dotnet_show_name_completion_suggestions'}, {'section': 'csharp|completion.dotnet_provide_regex_completions'}, {'section': 'visual_basic|completion.dotnet_provide_regex_completions'}, {'section': 'csharp|completion.dotnet_show_completion_items_from_unimported_namespaces'}, {'section': 'visual_basic|completion.dotnet_show_completion_items_from_unimported_namespaces'}, {'section': 'csharp|completion.dotnet_trigger_completion_in_argument_lists'}, {'section': 'visual_basic|completion.dotnet_trigger_completion_in_argument_lists'}, {'section': 'csharp|quick_info.dotnet_show_remarks_in_quick_info'}, {'section': 'visual_basic|quick_info.dotnet_show_remarks_in_quick_info'}, {'section': 'navigation.dotnet_navigate_to_decompiled_sources'}, {'section': 'csharp|highlighting.dotnet_highlight_related_json_components'}, {'section': 'visual_basic|highlighting.dotnet_highlight_related_json_components'}, {'section': 'csharp|highlighting.dotnet_highlight_related_regex_components'}, {'section': 'visual_basic|highlighting.dotnet_highlight_related_regex_components'}, {'section': 'csharp|inlay_hints.dotnet_enable_inlay_hints_for_parameters'}, {'section': 'visual_basic|inlay_hints.dotnet_enable_inlay_hints_for_parameters'}, {'section': 'csharp|inlay_hints.dotnet_enable_inlay_hints_for_literal_parameters'}, {'section': 'visual_basic|inlay_hints.dotnet_enable_inlay_hints_for_literal_parameters'}, {'section': 'csharp|inlay_hints.dotnet_enable_inlay_hints_for_indexer_parameters'}, {'section': 'visual_basic|inlay_hints.dotnet_enable_inlay_hints_for_indexer_parameters'}, {'section': 'csharp|inlay_hints.dotnet_enable_inlay_hints_for_object_creation_parameters'}, {'section': 'visual_basic|inlay_hints.dotnet_enable_inlay_hints_for_object_creation_parameters'}, {'section': 'csharp|inlay_hints.dotnet_enable_inlay_hints_for_other_parameters'}, {'section': 'visual_basic|inlay_hints.dotnet_enable_inlay_hints_for_other_parameters'}, {'section': 'csharp|inlay_hints.dotnet_suppress_inlay_hints_for_parameters_that_differ_only_by_suffix'}, {'section': 'visual_basic|inlay_hints.dotnet_suppress_inlay_hints_for_parameters_that_differ_only_by_suffix'}, {'section': 'csharp|inlay_hints.dotnet_suppress_inlay_hints_for_parameters_that_match_method_intent'}, {'section': 'visual_basic|inlay_hints.dotnet_suppress_inlay_hints_for_parameters_that_match_method_intent'}, {'section': 'csharp|inlay_hints.dotnet_suppress_inlay_hints_for_parameters_that_match_argument_name'}, {'section': 'visual_basic|inlay_hints.dotnet_suppress_inlay_hints_for_parameters_that_match_argument_name'}, {'section': 'csharp|inlay_hints.csharp_enable_inlay_hints_for_types'}, {'section': 'visual_basic|inlay_hints.csharp_enable_inlay_hints_for_types'}, {'section': 'csharp|inlay_hints.csharp_enable_inlay_hints_for_implicit_variable_types'}, {'section': 'visual_basic|inlay_hints.csharp_enable_inlay_hints_for_implicit_variable_types'}, {'section': 'csharp|inlay_hints.csharp_enable_inlay_hints_for_lambda_parameter_types'}, {'section': 'visual_basic|inlay_hints.csharp_enable_inlay_hints_for_lambda_parameter_types'}, {'section': 'csharp|inlay_hints.csharp_enable_inlay_hints_for_implicit_object_creation'}, {'section': 'visual_basic|inlay_hints.csharp_enable_inlay_hints_for_implicit_object_creation'}, {'section': 'csharp|inlay_hints.csharp_enable_inlay_hints_for_collection_expressions'}, {'section': 'visual_basic|inlay_hints.csharp_enable_inlay_hints_for_collection_expressions'}, {'section': 'csharp|code_style.formatting.indentation_and_spacing.tab_width'}, {'section': 'visual_basic|code_style.formatting.indentation_and_spacing.tab_width'}, {'section': 'csharp|code_style.formatting.indentation_and_spacing.indent_size'}, {'section': 'visual_basic|code_style.formatting.indentation_and_spacing.indent_size'}, {'section': 'csharp|code_style.formatting.indentation_and_spacing.indent_style'}, {'section': 'visual_basic|code_style.formatting.indentation_and_spacing.indent_style'}, {'section': 'csharp|code_style.formatting.new_line.end_of_line'}, {'section': 'visual_basic|code_style.formatting.new_line.end_of_line'}, {'section': 'code_style.formatting.new_line.insert_final_newline'}, {'section': 'csharp|background_analysis.dotnet_analyzer_diagnostics_scope'}, {'section': 'visual_basic|background_analysis.dotnet_analyzer_diagnostics_scope'}, {'section': 'csharp|background_analysis.dotnet_compiler_diagnostics_scope'}, {'section': 'visual_basic|background_analysis.dotnet_compiler_diagnostics_scope'}, {'section': 'csharp|code_lens.dotnet_enable_references_code_lens'}, {'section': 'visual_basic|code_lens.dotnet_enable_references_code_lens'}, {'section': 'csharp|code_lens.dotnet_enable_tests_code_lens'}, {'section': 'visual_basic|code_lens.dotnet_enable_tests_code_lens'}, {'section': 'projects.dotnet_binary_log_path'}, {'section': 'projects.dotnet_enable_automatic_restore'}, {'section': 'navigation.dotnet_navigate_to_source_link_and_embedded_sources'}]}
:: [01:50:04.474] >>> CSharp (3) (duration: 0ms): [None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, 'fullSolution', None, None, None, None, None, None, None, None, None, None]