-
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
Convert Clasp into a source package #72237
Conversation
protected readonly ILspLogger _logger; | ||
#pragma warning restore IDE1006 // Naming Styles |
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.
similar to the public api, modifying this would be a breaking change. So suppressing until after all consumers switch to the source package.
@@ -1,42 +0,0 @@ | |||
<?xml version="1.0" encoding="utf-8"?> |
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.
These were no longer used. the strings are in the protocol project. Additionally there was no resx file for any of these.
@@ -36,6 +36,9 @@ | |||
<PackageReference Include="Microsoft.ServiceHub.Client" /> | |||
<PackageReference Include="Microsoft.VisualStudio.Debugger.Contracts" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Compile Include="..\..\Compilers\Core\Portable\InternalUtilities\IsExternalInit.cs" Link="Utilities\IsExternalInit.cs" /> |
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.
seems like a bunch of projects were picking up this from the clasp project. Had to add it in a few places now that its become a source package.
bb7a37b
to
a4c1d86
Compare
public abstract class AbstractHandlerProvider | ||
#else | ||
internal abstract class AbstractHandlerProvider |
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.
The source package versions of these types need to be internal. Otherwise someone referencing Clasp directly, and MS.CA.LanguageServer.Protocol (for example, Razor) will get conflicting type definitions if they're public.
However, for binary compatibility in VS on the old non-source package versions of clasp, these APIs need to be public. So until we move all consumers to the source only version of the package, we have to ship the dll in VS with public accessibility.
a4c1d86
to
9430a78
Compare
206091f
to
eead0f9
Compare
@@ -2,6 +2,9 @@ | |||
// The .NET Foundation licenses this file to you under the MIT license. | |||
// See the LICENSE file in the project root for more information. | |||
|
|||
// This is consumed as 'generated' code in a source package and therefore requires an explicit nullable enable | |||
#nullable enable |
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.
we ship an .editorconfig in the package that marks all the code in here as generated code. This ensures that analyzers do not report diagnostics for these files when included as a source package (compiler warnings are still reported - unfortunately there is no way to disable that).
And generated code requires explicit nullable defines in order to use nullable annotations.
|
||
namespace Microsoft.CodeAnalysis.ExternalAccess.Xaml; | ||
|
||
internal interface IXamlRequestHandler<TRequest, TResponse> | ||
: IRequestHandler<TRequest, TResponse, XamlRequestContext> |
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 was incorrectly exposing the clasp type directly to XAML. making it internal broke their handlers. However XAML already wrapped this handler into a Roslyn typed handler (XamlRequestHandlerBase), so all we need to do here is copy the old signature directly here and remove the inheritance.
...geServerProtocol.Framework/Microsoft.CommonLanguageServerProtocol.Framework.Shared.projitems
Outdated
Show resolved
Hide resolved
/azp run roslyn-integration-CI |
Azure Pipelines successfully started running 1 pipeline(s). |
<PackageReference Include="StreamJsonRpc" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="..\..\..\Compilers\Core\Portable\InternalUtilities\IsExternalInit.cs" Link="Utilities\IsExternalInit.cs" /> |
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.
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 one? https://www.nuget.org/packages/IsExternalInit. I guess probably possible, but we don't own it and its one less dependency to manage, so I'd rather just use our version.
<Import_RootNamespace>Microsoft.CommonLanguageServerProtocol.Framework.Shared</Import_RootNamespace> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildThisFileDirectory)AbstractHandlerProvider.cs" /> |
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.
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.
Was autogenerated by VS - also seems to match what other shared projects do (probably because they were also autogenerated)
https://github.com/dotnet/roslyn/blob/main/src/Dependencies/PooledObjects/Microsoft.CodeAnalysis.PooledObjects.projitems
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.
eead0f9
to
fc6a1e4
Compare
fc6a1e4
to
e3a92bf
Compare
### Summary of the changes Now that dotnet/roslyn#72237 has merged on the Roslyn side, we need to update Razor to consume the source package version. This will allow us to delete the nuget package version - Fixes:
Converts clasp into a source package so we can make breaking changes without breaking consumers in VS. This package is not used for cross component communication (its an internal utility package).
In order to avoid a triple insertion, we still create a normal dll for insertion into VS. This can be removed when all consumers have updated to the source package version. That and additional cleanup is tracked here - #72251
Passing RPS - https://dev.azure.com/devdiv/DevDiv/_git/VS/pullrequest/532565