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

Fix issues with VSCode LSP EA causing handlers to fail to load #74700

Merged
merged 2 commits into from
Aug 9, 2024

Conversation

dibarbet
Copy link
Member

@dibarbet dibarbet commented Aug 9, 2024

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.

@dibarbet dibarbet requested a review from a team as a code owner August 9, 2024 19:28
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Aug 9, 2024
@@ -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)
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 was the issue for XAML - exposing the enum as a default value.

: base(type, ProtocolConstants.RoslynLspLanguagesContract, serverKind)
{
}

public ExportXamlLspServiceFactoryAttribute(Type type)
Copy link
Member Author

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.

@dibarbet
Copy link
Member Author

dibarbet commented Aug 9, 2024

/azp run roslyn-CI

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@davidwengier
Copy link
Contributor

Sorry!

@dibarbet dibarbet merged commit 5302da9 into dotnet:main Aug 9, 2024
25 checks passed
@dibarbet dibarbet deleted the fix_ea_lsp branch August 9, 2024 23:28
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Aug 9, 2024
@dibarbet dibarbet modified the milestones: Next, 17.12 P2 Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants