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

Don't generate documents for cohosting if we're not cohosting #9799

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ internal sealed class OpenDocumentGenerator(

public void Initialize(ProjectSnapshotManagerBase projectManager)
{
if (!_languageServerFeatureOptions.UseRazorCohostServer)
{
return;
}

_projectManager = projectManager;
_projectManager.Changed += ProjectManager_Changed;
}
Expand Down Expand Up @@ -190,7 +195,7 @@ private void ProjectManager_Changed(object sender, ProjectChangeEventArgs e)
{
// This is not ideal, but we need to re-use the existing snapshot version because our system uses the version
// of the text buffer, but a project change doesn't change the text buffer.
// See https://github.com/dotnet/razor/issues/9197 for more info and some issues this causese
// See https://github.com/dotnet/razor/issues/9197 for more info and some issues this causes
// This should all be moot eventually in Cohosting eventually anyway (ie, this whole file should be deleted)
_ = UpdateGeneratedDocumentsAsync(document, documentSnapshot.Version, CancellationToken.None);
}
Expand Down