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

Use ProvideSettingsManifest to specify Unfied Settings registration file #72429

Merged
merged 14 commits into from
Mar 13, 2024
30 changes: 15 additions & 15 deletions eng/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
</ItemGroup>

<ItemGroup Condition="'$(DotnetBuildFromSource)' != 'true' and '$(TargetFramework)' == 'net472'">
<PackageVersion Include="Microsoft.Build" Version="17.9.0-preview-23551-05" />
<PackageVersion Include="Microsoft.Build.Framework" Version="17.9.0-preview-23551-05" />
<PackageVersion Include="Microsoft.Build.Tasks.Core" Version="17.9.0-preview-23551-05" />
<PackageVersion Include="Microsoft.Build" Version="17.10.0-preview-24081-01" />
<PackageVersion Include="Microsoft.Build.Framework" Version="17.10.0-preview-24081-01" />
<PackageVersion Include="Microsoft.Build.Tasks.Core" Version="17.10.0-preview-24081-01" />
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -88,32 +88,32 @@
<!--
Subset of Microsoft.VisualStudio.Sdk meta-package (run `csi generate-vssdk-versions.csx` to update based on VSSDK meta-package).
-->
<PackageVersion Include="Microsoft.VisualStudio.Composition" Version="17.7.29" />
<PackageVersion Include="Microsoft.VisualStudio.Composition" Version="17.10.11-preview" />
<PackageVersion Include="Microsoft.VisualStudio.CoreUtility" Version="17.9.80-preview" />
<PackageVersion Include="Microsoft.VisualStudio.Editor" Version="17.9.80-preview" />
<PackageVersion Include="Microsoft.VisualStudio.ImageCatalog" Version="17.9.35796-preview.1" />
<PackageVersion Include="Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime" Version="17.9.35796-preview.1" />
<PackageVersion Include="Microsoft.VisualStudio.ImageCatalog" Version="17.10.639-preview.1" />
<PackageVersion Include="Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime" Version="17.10.616-preview.1" />
<PackageVersion Include="Microsoft.VisualStudio.Language.NavigateTo.Interfaces" Version="17.9.80-preview" />
<PackageVersion Include="Microsoft.VisualStudio.LanguageServer.Client" Version="17.9.25-preview" />
<PackageVersion Include="Microsoft.VisualStudio.Language.StandardClassification" Version="17.9.80-preview" />
<PackageVersion Include="Microsoft.VisualStudio.Language" Version="17.9.80-preview" />
<PackageVersion Include="Microsoft.VisualStudio.RemoteControl" Version="16.3.52" />
<PackageVersion Include="Microsoft.VisualStudio.RpcContracts" Version="17.9.5-alpha" />
<PackageVersion Include="Microsoft.VisualStudio.Shell.15.0" Version="17.9.35796-preview.1" />
<PackageVersion Include="Microsoft.VisualStudio.Telemetry" Version="17.9.13" />
<PackageVersion Include="Microsoft.VisualStudio.RpcContracts" Version="17.10.3-preview" />
<PackageVersion Include="Microsoft.VisualStudio.Shell.15.0" Version="17.10.639-preview.1" />
<PackageVersion Include="Microsoft.VisualStudio.Telemetry" Version="17.10.4" />
<PackageVersion Include="Microsoft.VisualStudio.Text.Data" Version="17.9.80-preview" />
<PackageVersion Include="Microsoft.VisualStudio.Text.Logic" Version="17.9.80-preview" />
<PackageVersion Include="Microsoft.VisualStudio.Text.UI" Version="17.9.80-preview" />
<PackageVersion Include="Microsoft.VisualStudio.Text.UI.Wpf" Version="17.9.80-preview" />
<PackageVersion Include="Microsoft.VisualStudio.Threading" Version="17.9.3-alpha" />
<PackageVersion Include="Microsoft.VisualStudio.Threading" Version="17.10.12-preview" />
<PackageVersion Include="Microsoft.VisualStudio.Utilities.Internal" Version="16.3.56" />
<PackageVersion Include="Nerdbank.Streams" Version="2.10.69" />
<PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
<PackageVersion Include="StreamJsonRpc" Version="2.17.9" />
<PackageVersion Include="StreamJsonRpc" Version="2.18.6-preview" />

<!-- TODO: workaround for https://github.com/dotnet/roslyn/issues/71377 -->
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.10.12-preview" />
<PackageVersion Include="Microsoft.VisualStudio.Composition.Analyzers" Version="17.7.40" />
<PackageVersion Include="Microsoft.VisualStudio.Composition.Analyzers" Version="17.10.11-preview" />
<PackageVersion Include="Microsoft.ServiceHub.Framework" Version="4.4.22"/>

<!--
Expand Down Expand Up @@ -188,7 +188,7 @@
<PackageVersion Include="System.CommandLine" Version="$(SystemCommandLineVersion)" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="$(SystemConfigurationConfigurationManagerVersion)" />
<PackageVersion Include="System.Composition" Version="$(SystemCompositionVersion)" />
<PackageVersion Include="System.ComponentModel.Composition" Version="7.0.0" />
<PackageVersion Include="System.ComponentModel.Composition" Version="8.0.0" />
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="$(SystemDiagnosticsDiagnosticSourceVersion)" />
<PackageVersion Include="System.Diagnostics.EventLog" Version="$(SystemDiagnosticsEventLogVersion)" />
<PackageVersion Include="System.IO.Hashing" Version="8.0.0" />
Expand All @@ -198,13 +198,13 @@
<PackageVersion Include="System.Numerics.Vectors" Version="4.5.0" />
<PackageVersion Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageVersion Include="System.Runtime.Loader" Version="4.3.0" />
<PackageVersion Include="System.Resources.Extensions" Version="7.0.0" />
<PackageVersion Include="System.Resources.Extensions" Version="8.0.0" />
<PackageVersion Include="System.Security.Cryptography.ProtectedData" Version="$(SystemSecurityCryptographyProtectedDataVersion)" />
<PackageVersion Include="System.Security.Permissions" Version="$(SystemSecurityPermissionsVersion)" />
<PackageVersion Include="System.Security.Principal" Version="4.3.0" />
<PackageVersion Include="System.Text.Encoding.CodePages" Version="7.0.0" />
<PackageVersion Include="System.Text.Encoding.Extensions" Version="4.3.0" />
<PackageVersion Include="System.Threading.Tasks.Dataflow" Version="7.0.0" />
<PackageVersion Include="System.Threading.Tasks.Dataflow" Version="8.0.0" />
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageVersion Include="System.Windows.Extensions" Version="$(SystemWindowsExtensionsVersion)" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Task<Stream> ISettingsManagerHost5.GetServiceStreamAsync(string serviceMoniker,
throw new NotImplementedException();
}

private sealed class StringStorage : IStringStorage, IAsyncStringStorage
private sealed class StringStorage : IStringStorage2, IAsyncStringStorage
{
private ImmutableDictionary<string, VersionedString> _values = ImmutableDictionary<string, VersionedString>.Empty;
private PropertyChangedEventHandler? _propertyChanged;
Expand Down Expand Up @@ -179,5 +179,10 @@ Task<ServiceUploadResult> IAsyncStringStorage.SetAsync(NamedVersionedString valu
{
throw new NotImplementedException();
}

void IStringStorage2.ForEachSettingNameStartingWith(string prefix, CharSpanProcessorDelegate processFunc)
{
throw new NotImplementedException();
}
}
}
1 change: 1 addition & 0 deletions src/VisualStudio/CSharp/Impl/CSharpPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ namespace Microsoft.VisualStudio.LanguageServices.CSharp.LanguageService
[ProvideLanguageEditorOptionPage(typeof(Options.Formatting.FormattingSpacingPage), "CSharp", @"Code Style\Formatting", "Spacing", pageNameResourceId: "#112", keywordListResourceId: 310)]
[ProvideLanguageEditorOptionPage(typeof(Options.NamingStylesOptionPage), "CSharp", @"Code Style", "Naming", pageNameResourceId: "#115", keywordListResourceId: 314)]
[ProvideLanguageEditorOptionPage(typeof(Options.IntelliSenseOptionPage), "CSharp", null, "IntelliSense", pageNameResourceId: "#103", keywordListResourceId: 312)]
[ProvideSettingsManifest(PackageRelativeManifestFile = @"UnifiedSettings\csharpSettings.registration.json")]
[Guid(Guids.CSharpPackageIdString)]
internal sealed class CSharpPackage : AbstractPackage<CSharpPackage, CSharpLanguageService>, IVsUserSettingsQuery
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
</PropertyGroup>
<ItemGroup>
<Content Update=".vsextension/string-resources.json" XlfPreserveFileName="true" />
<Content Include="UnifiedSettings/csharpSettings.registration.json" IncludeInVSIX="true" CopyToOutputDirectory="PreserveNewest" />
Copy link
Member Author

Choose a reason for hiding this comment

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

Move the registration file to this project, seem more reasonable to me because let it stays with the package

</ItemGroup>
<ItemGroup Label="PkgDef">
<PkgDefInstalledProduct Include="{13c3bbb4-f18f-4111-9f54-a0fb010d9194}" Name="Microsoft Visual C#" DisplayName="#116" ProductDetails="#117" />
Expand Down
7 changes: 7 additions & 0 deletions src/VisualStudio/CSharp/Impl/PackageRegistration.pkgdef
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,10 @@
"Package"="{13C3BBB4-F18F-4111-9F54-A0FB010D9194}"
"SortPriority"=dword:00000064
@="Microsoft Visual C#"

// CacheTag value should be changed when registration file changes
Copy link
Member

Choose a reason for hiding this comment

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

Is it autogenerated? Or does it have to be manually updated each time we add / change / remove a setting?

Manual updating seems problematic

Copy link
Member Author

Choose a reason for hiding this comment

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

It needs to be manually updated. But I think from the doc it only affects F5 deployment/Testing.

I learned from @JoshuaBStevens that there is a way to config this to be auto-genereated (There is a VS side PR sample to do this, but it is using internal tasks)
So either, 1. Investigate how to do this publicly. 2. Later when all things are moved to gladstone this could also be auto-generated.

All of these look like another work.

// See https://devdiv.visualstudio.com/DevDiv/_wiki/wikis/DevDiv.wiki/39345/Manifest-Build-Deployment-and-Setup-Authoring-In-Depth?anchor=example-pkgdef-key for more infomation
[$RootKey$\SettingsManifests\{13c3bbb4-f18f-4111-9f54-a0fb010d9194}]
@="Microsoft.VisualStudio.LanguageServices.CSharp.LanguageService.CSharpPackage"
"ManifestPath"="$PackageFolder$\UnifiedSettings\csharpSettings.registration.json"
"CacheTag"=qword:08DC1824DFE0117B
1 change: 0 additions & 1 deletion src/VisualStudio/Setup/Roslyn.VisualStudio.Setup.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,6 @@
<IncludeInVSIX>true</IncludeInVSIX>
<Visible>false</Visible>
</Content>
<Content Include="UnifiedSettings\*.registration.json" IncludeInVSIX="true" />
</ItemGroup>
<ItemGroup>
<None Include="source.extension.vsixmanifest">
Expand Down
Loading