-
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
Fix issues with VSCode LSP EA causing handlers to fail to load #74700
Conversation
...ageServer/Microsoft.CodeAnalysis.LanguageServer/Microsoft.CodeAnalysis.LanguageServer.csproj
Show resolved
Hide resolved
@@ -14,8 +14,14 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.Xaml; | |||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false), MetadataAttribute] | |||
internal sealed class ExportXamlLspServiceFactoryAttribute : ExportLspServiceFactoryAttribute | |||
{ | |||
public ExportXamlLspServiceFactoryAttribute(Type type, WellKnownLspServerKinds serverKind = WellKnownLspServerKinds.Any) |
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 the issue for XAML - exposing the enum as a default value.
: base(type, ProtocolConstants.RoslynLspLanguagesContract, serverKind) | ||
{ | ||
} | ||
|
||
public ExportXamlLspServiceFactoryAttribute(Type type) |
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.
@etvorun at some point once this change merges you'll want to update xaml to use this so Ican delete the old one.
src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/ExportProviderBuilder.cs
Outdated
Show resolved
Hide resolved
/azp run roslyn-CI |
Azure Pipelines successfully started running 1 pipeline(s). |
Sorry! |
2d311bd caused both @333fred 's compiler SDK extension and some XAML handlers to break.
This was caused due to the removal of the enum member, changing the numerical value of each. Code compiled against an older version of Roslyn that used the enum would be broken.
For the compiler SDK extension, this caused an issue because the enum was exposed in the EA library, which was being loaded from the extension (and not from roslyn). The fix is to ship and load the EA library from Roslyn (only 21kb).
For XAML, the LSP service factory exposed the enum as a default parameter, so all XAML LSP service factories had the wrong enum value. Xaml is updating their Roslyn version to fix, but here I also obsolete the API that exposed the enum (it wasn't necessary).
Also fixed an issue where MEF discovery errors werent being recorded.