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

Initialize Razor even if Razor doc isn't opened yet #6473

Merged

Conversation

allisonchou
Copy link
Contributor

@allisonchou allisonchou commented Oct 3, 2023

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1825836, aka the scenario where:

  • There is a Razor doc in the workspace
  • No Razor file has been opened yet
  • User attempts to open a C# doc referencing Razor components

In the above scenario, we get errors like this in the C# file:
image

We were initially trying to avoid unnecessary work by not initializing Razor until a Razor file is actually opened. However, it creates bugs like above which have been reported multiple times.

@allisonchou allisonchou requested a review from a team as a code owner October 3, 2023 00:07
Copy link
Contributor

@davidwengier davidwengier left a comment

Choose a reason for hiding this comment

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

Well I guess this settles the "should Razor be a runtime dependency" argument once and for all 😁

@allisonchou allisonchou merged commit 1c109e8 into dotnet:main Oct 3, 2023
8 checks passed
@allisonchou allisonchou deleted the dev/allichou/FixRazorDiscovery branch October 3, 2023 00:30
allisonchou added a commit to allisonchou/omnisharp-vscode that referenced this pull request Oct 3, 2023
arkalyanms added a commit that referenced this pull request Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants