-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Rewrite unified settings test #76591
Conversation
@@ -449,9 +449,12 @@ | |||
<value>In other binary operators: && || ?? 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"> |
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.
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
</ItemGroup> | ||
<ItemGroup> | ||
<EmbeddedResource Update="CSharpVSResources.resx" GenerateSource="true" /> | ||
<EmbeddedResource Update="VSPackage.resx"> | ||
<EmbeddedResource Update="VSPackage.resx" GenerateSource="true" Namespace="Microsoft.VisualStudio.LanguageServices.CSharp" > |
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 needed because in test I need to validate the LOC strings from VSPackage.resx
|
||
namespace Roslyn.VisualStudio.Next.UnitTests.UnifiedSettings.TestModel; | ||
|
||
internal abstract record UnifiedSettingBase |
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.
All these classes are just mapping to the csharpSettings.registration.json
so it's easier to make assertions to verify the properties.
@@ -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 |
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.
what is this?
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.
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
Previously the test in src/VisualStudio/Core/Test/UnifiedSettings/VisualBasicUnifiedSettingsTests.vb 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: