Skip to content
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

Rewrite unified settings test #76591

Merged
merged 45 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
99fd81c
Update the test model
Cosifne Dec 11, 2024
52dce40
Add category model
Cosifne Dec 11, 2024
8be1831
Add test
Cosifne Dec 11, 2024
298cad6
Add details
Cosifne Dec 11, 2024
ccf1864
Add CategoriesTest
Cosifne Dec 12, 2024
7d00a4b
Update alternateDefault
Cosifne Dec 12, 2024
3849b2e
Back to newtonsoft.json
Cosifne Dec 12, 2024
f5cb030
Update input
Cosifne Dec 12, 2024
c4987d4
Clean
Cosifne Dec 13, 2024
2cbbeff
test the first option
Cosifne Dec 13, 2024
e5cc574
Modify the resources
Cosifne Dec 13, 2024
505227a
Fix test
Cosifne Dec 13, 2024
bb6cdef
Move test to NextUnitTests
Cosifne Dec 14, 2024
d15cb2a
Move to C#!
Cosifne Dec 14, 2024
4d1f33d
Add converter
Cosifne Dec 14, 2024
db9a31b
Add setting
Cosifne Dec 14, 2024
f9d6f86
Modify test model
Cosifne Dec 16, 2024
2f7d983
File scope namespace
Cosifne Dec 16, 2024
a66774b
Add enum model
Cosifne Dec 17, 2024
fd492ee
Add enum constructor
Cosifne Dec 17, 2024
fc8c1f8
Delete unused types
Cosifne Dec 17, 2024
a64b29c
Refactoring
Cosifne Dec 18, 2024
2ca1797
Change to array
Cosifne Dec 19, 2024
9c2fed4
Fix string
Cosifne Dec 19, 2024
031316a
Correct the string
Cosifne Dec 19, 2024
7b80677
Correct the typo in property name
Cosifne Dec 19, 2024
ce672ca
Add another converter
Cosifne Dec 20, 2024
c261415
Imple Equals and GetHashCode
Cosifne Dec 20, 2024
3d60864
Fix string
Cosifne Dec 20, 2024
9ac6bd2
Fix string
Cosifne Dec 20, 2024
01a8fcc
Add tag helper
Cosifne Dec 20, 2024
f3148df
Add category test
Cosifne Dec 20, 2024
8ab888d
Add messages
Cosifne Dec 20, 2024
06b1b28
Message covered by test
Cosifne Dec 20, 2024
6d1e523
Add CSharp dictionary
Cosifne Dec 20, 2024
21c5a59
Add C# category test
Cosifne Dec 21, 2024
93bd075
Add C# test
Cosifne Dec 21, 2024
6191f8c
correct strings
Cosifne Dec 21, 2024
dfd977d
Correct strings
Cosifne Dec 30, 2024
483c4a8
Correct pkgdef
Cosifne Dec 30, 2024
2e8bad9
Fix formatting
Cosifne Dec 31, 2024
1abb24e
Delete dead code
Cosifne Dec 31, 2024
2f867e6
Add comment
Cosifne Dec 31, 2024
7ea23ce
File scope ns
Cosifne Dec 31, 2024
87d6ec9
Remove dead code
Cosifne Jan 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.LiveShare" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests" />
<InternalsVisibleTo Include="Roslyn.Hosting.Diagnostics" />
<InternalsVisibleTo Include="Roslyn.VisualStudio.Next.UnitTests" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="CSharpEditorResources.resx" GenerateSource="true" />
Expand Down
8 changes: 7 additions & 1 deletion src/VisualStudio/CSharp/Impl/CSharpVSResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,12 @@
<value>In other binary operators: &amp;&amp; || ?? and or</value>
<comment>'and' and 'or' are C# keywords and should not be localized</comment>
</data>
<data name="Show_name_suggestions" xml:space="preserve">
<data name="Show_name_s_uggestions" xml:space="preserve">
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://devdiv.visualstudio.com/DevDiv/_wiki/wikis/DevDiv.wiki/38111/Guide-for-setting-owners?anchor=titles
See the recommended title here, accelerator key is not needed in unified settings. But in our own legacy page we need that _
Many string changes in this PR is caused by this

<value>Show name s_uggestions</value>
</data>
<data name="Show_name_suggestions" xml:space="preserve">
<value>Show name suggestions</value>
</data>
<data name="In_relational_binary_operators" xml:space="preserve">
<value>In relational operators: &lt; &gt; &lt;= &gt;= is as == !=</value>
<comment>'is' and 'as' are C# keywords and should not be localized</comment>
Expand Down Expand Up @@ -533,6 +536,9 @@
<data name="Show_new_snippet_experience_experimental" xml:space="preserve">
<value>Show new snippet experience (experimental)</value>
</data>
<data name="Show_new_snippet_experience" xml:space="preserve">
<value>Show new snippet experience</value>
</data>
<data name="Allow_blank_line_after_token_in_conditional_expression" xml:space="preserve">
<value>Allow blank line after token in conditional expression</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.UnitTests" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Test.Utilities2" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.New.IntegrationTests" />
<InternalsVisibleTo Include="Roslyn.VisualStudio.Next.UnitTests" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="CSharpVSResources.resx" GenerateSource="true" />
<EmbeddedResource Update="VSPackage.resx">
<EmbeddedResource Update="VSPackage.resx" GenerateSource="true" Namespace="Microsoft.VisualStudio.LanguageServices.CSharp" >
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed because in test I need to validate the LOC strings from VSPackage.resx

<MergeWithCTO>true</MergeWithCTO>
<ManifestResourceName>VSPackage</ManifestResourceName>
<SubType>Designer</SubType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@

<CheckBox x:Uid="Show_name_suggestions"
x:Name="Show_name_suggestions"
Content="{x:Static local:IntelliSenseOptionPageStrings.Option_Show_name_suggestions}" />
Content="{x:Static local:IntelliSenseOptionPageStrings.Option_Show_name_s_uggestions}" />

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

<CheckBox x:Uid="Tab_twice_to_insert_arguments"
x:Name="Tab_twice_to_insert_arguments"
Content="{x:Static local:IntelliSenseOptionPageStrings.Option_Tab_twice_to_insert_arguments}" />
Content="{x:Static local:IntelliSenseOptionPageStrings.Option_Tab_twice_to_insert_arguments_experimental}" />

<CheckBox x:Uid="Show_new_snippet_experience"
x:Name="Show_new_snippet_experience"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ namespace Microsoft.VisualStudio.LanguageServices.CSharp.Options
internal static class IntelliSenseOptionPageStrings
{
public static string Option_Show_completion_list_after_a_character_is_typed
=> ServicesVSResources.Show_completion_list_after_a_character_is_typed;
=> ServicesVSResources._Show_completion_list_after_a_character_is_typed;

public static string Option_Show_completion_list_after_a_character_is_deleted
=> ServicesVSResources.Show_completion_list_after_a_character_is_deleted;
=> ServicesVSResources.Show_completion_list_after_a_character_is__deleted;

public static string Option_Completion
{
Expand All @@ -35,10 +35,10 @@ public static string Option_ShowSnippets
}

public static string Option_Highlight_matching_portions_of_completion_list_items
=> ServicesVSResources.Highlight_matching_portions_of_completion_list_items;
=> ServicesVSResources._Highlight_matching_portions_of_completion_list_items;

public static string Option_Show_completion_item_filters
=> ServicesVSResources.Show_completion_item_filters;
=> ServicesVSResources.Show_completion_item__filters;

public static string Option_Automatically_complete_statement_on_semicolon => CSharpVSResources.Automatically_complete_statement_on_semicolon;

Expand Down Expand Up @@ -66,14 +66,14 @@ public static string Option_Always_include_snippets
public static string Option_Include_snippets_when_question_Tab_is_typed_after_an_identifier
=> CSharpVSResources.Include_snippets_when_Tab_is_typed_after_an_identifier;

public static string Option_Show_name_suggestions
=> CSharpVSResources.Show_name_suggestions;
public static string Option_Show_name_s_uggestions
=> CSharpVSResources.Show_name_s_uggestions;

public static string Option_Show_items_from_unimported_namespaces
=> ServicesVSResources.Show_items_from_unimported_namespaces;

public static string Option_Tab_twice_to_insert_arguments
=> ServicesVSResources.Tab_twice_to_insert_arguments;
public static string Option_Tab_twice_to_insert_arguments_experimental
=> ServicesVSResources.Tab_twice_to_insert_arguments_experimental;

public static string Automatically_show_completion_list_in_argument_lists
=> CSharpVSResources.Automatically_show_completion_list_in_argument_lists;
Expand Down
2 changes: 1 addition & 1 deletion src/VisualStudio/CSharp/Impl/PackageRegistration.pkgdef
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,4 @@
[$RootKey$\SettingsManifests\{13c3bbb4-f18f-4111-9f54-a0fb010d9194}]
@="Microsoft.VisualStudio.LanguageServices.CSharp.LanguageService.CSharpPackage"
"ManifestPath"="$PackageFolder$\UnifiedSettings\csharpSettings.registration.json"
"CacheTag"=qword:3AEFDB0DA1308654
"CacheTag"=qword:18C11F0A543B8AD0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you add/modify properties in csharpSettings.registration.json, you need to change this key to make sure the registration file take effect. Also It is useful if you want to deploy and test locally (like devenv /rootsuffix RoslynDev), everytime you change the value, VS would reload the C# page.

The tag value we used is generated by xxHash with the input of csharpSettings.registration.json, so it's also covered by unit test. When someone forget to modify it, test will fail

Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"title": "@Snippets_behavior;..\\Microsoft.VisualStudio.LanguageServices.dll",
"type": "string",
"enum": [ "neverInclude", "alwaysInclude", "includeAfterTypingIdentifierQuestionTab" ],
"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}" ],
"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" ],
"default": "alwaysInclude",
"order": 50,
"migration": {
Expand Down Expand Up @@ -136,7 +136,7 @@
},
// CompletionOptionsStorage.EnterKeyBehavior
"textEditor.csharp.intellisense.returnKeyCompletionBehavior": {
"title": "@Enter_key_behavior_colon;..\\Microsoft.VisualStudio.LanguageServices.dll",
"title": "@Enter_key_behavior;..\\Microsoft.VisualStudio.LanguageServices.dll",
"type": "string",
"enum": [ "never", "afterFullyTypedWord", "always" ],
"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}" ],
Expand Down Expand Up @@ -209,6 +209,11 @@
"type": "boolean",
"default": false,
"order": 90,
"messages": [
{
"text": "@Experimental_feature;..\\Microsoft.VisualStudio.LanguageServices.dll"
}
],
"migration": {
"pass": {
"input": {
Expand All @@ -220,9 +225,14 @@
},
// CompletionOptionsStorage.ShowNewSnippetExperienceUserOption
"textEditor.csharp.intellisense.showNewSnippetExperience": {
"title": "@Show_new_snippet_experience_experimental;..\\Microsoft.VisualStudio.LanguageServices.CSharp.dll",
"title": "@Show_new_snippet_experience;..\\Microsoft.VisualStudio.LanguageServices.CSharp.dll",
"type": "boolean",
"default": false,
"messages": [
{
"text": "@Experimental_feature;..\\Microsoft.VisualStudio.LanguageServices.dll"
}
],
"alternateDefault": {
// CompletionOptionsStorage.ShowNewSnippetExperienceFeatureFlag
"flagName": "Roslyn.SnippetCompletion",
Expand All @@ -241,7 +251,7 @@
},
"categories": {
"textEditor.csharp":{
"title": "C#"
"title": "@101;{13c3bbb4-f18f-4111-9f54-a0fb010d9194}"
},
"textEditor.csharp.intellisense": {
"title": "@103;{13c3bbb4-f18f-4111-9f54-a0fb010d9194}",
Expand Down
14 changes: 12 additions & 2 deletions src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.de.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.es.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.fr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.it.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.ja.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.ko.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions src/VisualStudio/CSharp/Impl/xlf/CSharpVSResources.pl.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading