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 IEventListener to register workspaces for LSP instead of inside AbstractPackage #50387

Merged
1 commit merged into from
Jan 12, 2021

Conversation

dibarbet
Copy link
Member

Per @jasonmalinowski AbstractPackage initialization is only used for certain initialization paths (e.g. tools options, object browser, old project system com bits). In general other roslyn initialization is done via MEF and does not go through the UI thread bound package initialization.

So instead of registering workspaces in the package load (which doesn't match 1:1 with workspace creation) we instead register the workspaces exactly when they are created via the IEventListener infrastructure.

Fixes #50386

@dibarbet dibarbet added Area-IDE LSP issues related to the roslyn language server protocol implementation labels Jan 12, 2021
@dibarbet dibarbet requested a review from a team as a code owner January 12, 2021 02:41
@dibarbet dibarbet force-pushed the fix_razor_workspace_registration branch from 58f19ee to c8fd0c9 Compare January 12, 2021 02:41
@dibarbet dibarbet changed the title Use IEventListeners to register workspaces for LSP instead of inside AbstractPackage Use IEventListener to register workspaces for LSP instead of inside AbstractPackage Jan 12, 2021
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Auto-approval

@ghost ghost merged commit fcb815e into dotnet:master Jan 12, 2021
@ghost ghost added this to the Next milestone Jan 12, 2021
@dibarbet dibarbet deleted the fix_razor_workspace_registration branch January 12, 2021 19:25
@jasonmalinowski
Copy link
Member

Missed this earlier in my inbox but looks good!

@Cosifne Cosifne modified the milestones: Next, 16.9 Jan 27, 2021
@JoeRobich JoeRobich modified the milestones: 16.9, 16.9.P4 Jan 27, 2021
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE auto-merge LSP issues related to the roslyn language server protocol implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[LSP] LSP server throws exception and shutsdown when only razor file is opened.
5 participants