-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test to make sure option names won't change #69319
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.Immutable; | ||
using System.Linq; | ||
using System.Text.RegularExpressions; | ||
using System.Threading; | ||
|
@@ -104,6 +105,48 @@ public class A { }"; | |
VerifyValuesInServer(server.TestWorkspace, clientCallbackTarget.MockClientSideValues); | ||
} | ||
|
||
[Fact] | ||
public void VerifyLspClientOptionNames() | ||
{ | ||
var actualNames = DidChangeConfigurationNotificationHandler.SupportedOptions.Select( | ||
DidChangeConfigurationNotificationHandler.GenerateFullNameForOption).ToArray(); | ||
// These options are persist in the LSP client. Please make sure also modify the LSP client code if these strings are changed. | ||
var expectedNames = new[] | ||
{ | ||
"symbol_search.dotnet_search_reference_assemblies", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we have this sorted and use one of our sort-ignoring Assert functions? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah it's possible |
||
"implement_type.dotnet_insertion_behavior", | ||
"implement_type.dotnet_property_generation_behavior", | ||
"completion.dotnet_show_name_completion_suggestions", | ||
"completion.dotnet_provide_regex_completions", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this be something like dotnet.completion.provideRegexCompletions? Or am I misunderstanding what this test is trying to do? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So the test here is just to make sure the option name + option group doesn't get changed. (because these strings would be used in the client, if it only gets changed in server client-side storage would be broken) For |
||
"completion.dotnet_show_completion_items_from_unimported_namespaces", | ||
"quick_info.dotnet_show_remarks_in_quick_info", | ||
"navigation.dotnet_navigate_to_decompiled_sources", | ||
"highlighting.dotnet_highlight_related_json_components", | ||
"highlighting.dotnet_highlight_related_regex_components", | ||
"inlay_hints.dotnet_enable_inlay_hints_for_parameters", | ||
"inlay_hints.dotnet_enable_inlay_hints_for_literal_parameters", | ||
"inlay_hints.dotnet_enable_inlay_hints_for_indexer_parameters", | ||
"inlay_hints.dotnet_enable_inlay_hints_for_object_creation_parameters", | ||
"inlay_hints.dotnet_enable_inlay_hints_for_other_parameters", | ||
"inlay_hints.dotnet_suppress_inlay_hints_for_parameters_that_differ_only_by_suffix", | ||
"inlay_hints.dotnet_suppress_inlay_hints_for_parameters_that_match_method_intent", | ||
"inlay_hints.dotnet_suppress_inlay_hints_for_parameters_that_match_argument_name", | ||
"inlay_hints.csharp_enable_inlay_hints_for_types", | ||
"inlay_hints.csharp_enable_inlay_hints_for_implicit_variable_types", | ||
"inlay_hints.csharp_enable_inlay_hints_for_lambda_parameter_types", | ||
"inlay_hints.csharp_enable_inlay_hints_for_implicit_object_creation", | ||
"code_style.formatting.indentation_and_spacing.tab_width", | ||
"code_style.formatting.indentation_and_spacing.indent_size", | ||
"code_style.formatting.indentation_and_spacing.indent_style", | ||
"code_style.formatting.new_line.end_of_line", | ||
"code_style.formatting.new_line.insert_final_newline", | ||
"background_analysis.dotnet_analyzer_diagnostics_scope", | ||
"background_analysis.dotnet_compiler_diagnostics_scope" | ||
}; | ||
|
||
Assert.Equal(expectedNames, actualNames); | ||
} | ||
|
||
private static void VerifyValuesInServer(TestWorkspace workspace, List<string> expectedValues) | ||
{ | ||
var globalOptionService = workspace.GetService<IGlobalOptionService>(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a duplicate (See line 31)