Skip to content

Commit 692a6cc

Browse files
authored
Rewrite unified settings test (#76591)
Previously the test in [src/VisualStudio/Core/Test/UnifiedSettings/VisualBasicUnifiedSettingsTests.vb](https://github.com/dotnet/roslyn/compare/main...Cosifne:dev/shech/upgradeUnifiedSettingsTest?expand=1#diff-d00c0d46bc861b74969a4a069ba220df3951e605514dd897bf9b89ddfe98f439) does not cover all the properties (especially, the localization string) in unified settings registration, and we have regressed the strings back in dfc660c#diff-a16de2a58a10f14a7fc8512f47bbd467869339a6135046bb0274d2fce1151f93R1901 This PR revises all the tests using STJ instead of using JSON path to do all the assertion. Also it modifies a few strings to fit the unified setting model. It's mainly a test only change. The only difference in the product is in Unified Settting page: ![image](https://github.com/user-attachments/assets/1960bfb1-dbb2-4ec5-92f9-ac0b1e2d0091)
2 parents d29eff1 + 87d6ec9 commit 692a6cc

File tree

64 files changed

+1656
-677
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1656
-677
lines changed

src/EditorFeatures/CSharp/Microsoft.CodeAnalysis.CSharp.EditorFeatures.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.LiveShare" />
3535
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests" />
3636
<InternalsVisibleTo Include="Roslyn.Hosting.Diagnostics" />
37+
<InternalsVisibleTo Include="Roslyn.VisualStudio.Next.UnitTests" />
3738
</ItemGroup>
3839
<ItemGroup>
3940
<EmbeddedResource Update="CSharpEditorResources.resx" GenerateSource="true" />

src/VisualStudio/CSharp/Impl/CSharpVSResources.resx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,12 @@
449449
<value>In other binary operators: &amp;&amp; || ?? and or</value>
450450
<comment>'and' and 'or' are C# keywords and should not be localized</comment>
451451
</data>
452-
<data name="Show_name_suggestions" xml:space="preserve">
452+
<data name="Show_name_s_uggestions" xml:space="preserve">
453453
<value>Show name s_uggestions</value>
454454
</data>
455+
<data name="Show_name_suggestions" xml:space="preserve">
456+
<value>Show name suggestions</value>
457+
</data>
455458
<data name="In_relational_binary_operators" xml:space="preserve">
456459
<value>In relational operators: &lt; &gt; &lt;= &gt;= is as == !=</value>
457460
<comment>'is' and 'as' are C# keywords and should not be localized</comment>
@@ -533,6 +536,9 @@
533536
<data name="Show_new_snippet_experience_experimental" xml:space="preserve">
534537
<value>Show new snippet experience (experimental)</value>
535538
</data>
539+
<data name="Show_new_snippet_experience" xml:space="preserve">
540+
<value>Show new snippet experience</value>
541+
</data>
536542
<data name="Allow_blank_line_after_token_in_conditional_expression" xml:space="preserve">
537543
<value>Allow blank line after token in conditional expression</value>
538544
</data>

src/VisualStudio/CSharp/Impl/Microsoft.VisualStudio.LanguageServices.CSharp.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@
5151
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.UnitTests" />
5252
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Test.Utilities2" />
5353
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.New.IntegrationTests" />
54+
<InternalsVisibleTo Include="Roslyn.VisualStudio.Next.UnitTests" />
5455
</ItemGroup>
5556
<ItemGroup>
5657
<EmbeddedResource Update="CSharpVSResources.resx" GenerateSource="true" />
57-
<EmbeddedResource Update="VSPackage.resx">
58+
<EmbeddedResource Update="VSPackage.resx" GenerateSource="true" Namespace="Microsoft.VisualStudio.LanguageServices.CSharp" >
5859
<MergeWithCTO>true</MergeWithCTO>
5960
<ManifestResourceName>VSPackage</ManifestResourceName>
6061
<SubType>Designer</SubType>

src/VisualStudio/CSharp/Impl/Options/IntelliSenseOptionPageControl.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@
6868

6969
<CheckBox x:Uid="Show_name_suggestions"
7070
x:Name="Show_name_suggestions"
71-
Content="{x:Static local:IntelliSenseOptionPageStrings.Option_Show_name_suggestions}" />
71+
Content="{x:Static local:IntelliSenseOptionPageStrings.Option_Show_name_s_uggestions}" />
7272

7373
<CheckBox x:Uid="Show_items_from_unimported_namespaces"
7474
x:Name="Show_items_from_unimported_namespaces"
7575
Content="{x:Static local:IntelliSenseOptionPageStrings.Option_Show_items_from_unimported_namespaces}" />
7676

7777
<CheckBox x:Uid="Tab_twice_to_insert_arguments"
7878
x:Name="Tab_twice_to_insert_arguments"
79-
Content="{x:Static local:IntelliSenseOptionPageStrings.Option_Tab_twice_to_insert_arguments}" />
79+
Content="{x:Static local:IntelliSenseOptionPageStrings.Option_Tab_twice_to_insert_arguments_experimental}" />
8080

8181
<CheckBox x:Uid="Show_new_snippet_experience"
8282
x:Name="Show_new_snippet_experience"

src/VisualStudio/CSharp/Impl/Options/IntelliSenseOptionPageStrings.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ namespace Microsoft.VisualStudio.LanguageServices.CSharp.Options
99
internal static class IntelliSenseOptionPageStrings
1010
{
1111
public static string Option_Show_completion_list_after_a_character_is_typed
12-
=> ServicesVSResources.Show_completion_list_after_a_character_is_typed;
12+
=> ServicesVSResources._Show_completion_list_after_a_character_is_typed;
1313

1414
public static string Option_Show_completion_list_after_a_character_is_deleted
15-
=> ServicesVSResources.Show_completion_list_after_a_character_is_deleted;
15+
=> ServicesVSResources.Show_completion_list_after_a_character_is__deleted;
1616

1717
public static string Option_Completion
1818
{
@@ -35,10 +35,10 @@ public static string Option_ShowSnippets
3535
}
3636

3737
public static string Option_Highlight_matching_portions_of_completion_list_items
38-
=> ServicesVSResources.Highlight_matching_portions_of_completion_list_items;
38+
=> ServicesVSResources._Highlight_matching_portions_of_completion_list_items;
3939

4040
public static string Option_Show_completion_item_filters
41-
=> ServicesVSResources.Show_completion_item_filters;
41+
=> ServicesVSResources.Show_completion_item__filters;
4242

4343
public static string Option_Automatically_complete_statement_on_semicolon => CSharpVSResources.Automatically_complete_statement_on_semicolon;
4444

@@ -66,14 +66,14 @@ public static string Option_Always_include_snippets
6666
public static string Option_Include_snippets_when_question_Tab_is_typed_after_an_identifier
6767
=> CSharpVSResources.Include_snippets_when_Tab_is_typed_after_an_identifier;
6868

69-
public static string Option_Show_name_suggestions
70-
=> CSharpVSResources.Show_name_suggestions;
69+
public static string Option_Show_name_s_uggestions
70+
=> CSharpVSResources.Show_name_s_uggestions;
7171

7272
public static string Option_Show_items_from_unimported_namespaces
7373
=> ServicesVSResources.Show_items_from_unimported_namespaces;
7474

75-
public static string Option_Tab_twice_to_insert_arguments
76-
=> ServicesVSResources.Tab_twice_to_insert_arguments;
75+
public static string Option_Tab_twice_to_insert_arguments_experimental
76+
=> ServicesVSResources.Tab_twice_to_insert_arguments_experimental;
7777

7878
public static string Automatically_show_completion_list_in_argument_lists
7979
=> CSharpVSResources.Automatically_show_completion_list_in_argument_lists;

src/VisualStudio/CSharp/Impl/PackageRegistration.pkgdef

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,4 +198,4 @@
198198
[$RootKey$\SettingsManifests\{13c3bbb4-f18f-4111-9f54-a0fb010d9194}]
199199
@="Microsoft.VisualStudio.LanguageServices.CSharp.LanguageService.CSharpPackage"
200200
"ManifestPath"="$PackageFolder$\UnifiedSettings\csharpSettings.registration.json"
201-
"CacheTag"=qword:3AEFDB0DA1308654
201+
"CacheTag"=qword:18C11F0A543B8AD0

src/VisualStudio/CSharp/Impl/UnifiedSettings/csharpSettings.registration.json

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
"title": "@Snippets_behavior;..\\Microsoft.VisualStudio.LanguageServices.dll",
101101
"type": "string",
102102
"enum": [ "neverInclude", "alwaysInclude", "includeAfterTypingIdentifierQuestionTab" ],
103-
"enumItemLabels": [ "@Never_include_snippets;{13c3bbb4-f18f-4111-9f54-a0fb010d9194}", "@Always_include_snippets;{13c3bbb4-f18f-4111-9f54-a0fb010d9194}", "@Include_snippets_when_Tab_is_typed_after_an_identifier;{13c3bbb4-f18f-4111-9f54-a0fb010d9194}" ],
103+
"enumItemLabels": [ "@Never_include_snippets;..\\Microsoft.VisualStudio.LanguageServices.dll", "@Always_include_snippets;..\\Microsoft.VisualStudio.LanguageServices.CSharp.dll", "@Include_snippets_when_Tab_is_typed_after_an_identifier;..\\Microsoft.VisualStudio.LanguageServices.CSharp.dll" ],
104104
"default": "alwaysInclude",
105105
"order": 50,
106106
"migration": {
@@ -136,7 +136,7 @@
136136
},
137137
// CompletionOptionsStorage.EnterKeyBehavior
138138
"textEditor.csharp.intellisense.returnKeyCompletionBehavior": {
139-
"title": "@Enter_key_behavior_colon;..\\Microsoft.VisualStudio.LanguageServices.dll",
139+
"title": "@Enter_key_behavior;..\\Microsoft.VisualStudio.LanguageServices.dll",
140140
"type": "string",
141141
"enum": [ "never", "afterFullyTypedWord", "always" ],
142142
"enumItemLabels": [ "@Never_add_new_line_on_enter;{13c3bbb4-f18f-4111-9f54-a0fb010d9194}", "@Only_add_new_line_on_enter_after_end_of_fully_typed_word;..\\Microsoft.VisualStudio.LanguageServices.dll", "@Always_add_new_line_on_enter;{13c3bbb4-f18f-4111-9f54-a0fb010d9194}" ],
@@ -209,6 +209,11 @@
209209
"type": "boolean",
210210
"default": false,
211211
"order": 90,
212+
"messages": [
213+
{
214+
"text": "@Experimental_feature;..\\Microsoft.VisualStudio.LanguageServices.dll"
215+
}
216+
],
212217
"migration": {
213218
"pass": {
214219
"input": {
@@ -220,9 +225,14 @@
220225
},
221226
// CompletionOptionsStorage.ShowNewSnippetExperienceUserOption
222227
"textEditor.csharp.intellisense.showNewSnippetExperience": {
223-
"title": "@Show_new_snippet_experience_experimental;..\\Microsoft.VisualStudio.LanguageServices.CSharp.dll",
228+
"title": "@Show_new_snippet_experience;..\\Microsoft.VisualStudio.LanguageServices.CSharp.dll",
224229
"type": "boolean",
225230
"default": false,
231+
"messages": [
232+
{
233+
"text": "@Experimental_feature;..\\Microsoft.VisualStudio.LanguageServices.dll"
234+
}
235+
],
226236
"alternateDefault": {
227237
// CompletionOptionsStorage.ShowNewSnippetExperienceFeatureFlag
228238
"flagName": "Roslyn.SnippetCompletion",
@@ -241,7 +251,7 @@
241251
},
242252
"categories": {
243253
"textEditor.csharp":{
244-
"title": "C#"
254+
"title": "@101;{13c3bbb4-f18f-4111-9f54-a0fb010d9194}"
245255
},
246256
"textEditor.csharp.intellisense": {
247257
"title": "@103;{13c3bbb4-f18f-4111-9f54-a0fb010d9194}",

src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.cs.xlf

Lines changed: 12 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.de.xlf

Lines changed: 12 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.es.xlf

Lines changed: 12 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)