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 FUSE hook up in VS Code #11175

Merged
merged 3 commits into from
Nov 8, 2024

Conversation

davidwengier
Copy link
Contributor

This one might be a little controversial in terms of how I wired the LanguageServerFeatureOptions up through the ProjectSnapshot, but it's somewhat similar to how it works in cohosting, with RemoteProjectSnapshot -> RemoteSolutionSnapshot -> SolutionSnapshotManager -> LanguageServerFeatureOptions.

Aside from that aspect of the specific implementation, which you're more than welcome to critique and suggest an alternative to, the fundamental change here is removing LanguageServerFlags and using LanguageServerFeatureOptions directly. It seems that LanguageServerFlags was intended to encapsulate the feature options for the compiler, but since that time they are never actually used by the compiler, and just ended up in a weird spot. They were "flags for the language server", but were only ever initialized in VS. We we essentially ended up with this unnecessary middle-man, that didn't always exist. The LanguageServerFeatureFlags on the other hand are always set in VS, VS Code, etc.

TL;DR: Now that all of the code for deciding whether to use runtime compilation is entirely on the tooling side, it just makes sense to use the tooling side options class directly.

These flags were explicitly not for the compiler, being not serialized, and hence don't really belong on RazorConfiguration.
They also were only ever set in the VS layer
@davidwengier davidwengier requested review from a team as code owners November 7, 2024 03:15
@@ -35,37 +36,26 @@ internal class ProjectState
private readonly object _lock;

private readonly IProjectEngineFactoryProvider _projectEngineFactoryProvider;
private readonly LanguageServerFeatureOptions _languageServerFeatureOptions;
private RazorProjectEngine? _projectEngine;

public static ProjectState Create(
Copy link
Contributor

Choose a reason for hiding this comment

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

❓ I've always wondered why we have a create here that doesn't do any work other than just call the constructor with the same things. Not unique to this PR though

Copy link
Member

Choose a reason for hiding this comment

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

💭 I suspect it's modeled on Roslyn's APIs like Compilation.

Copy link
Member

@DustinCampbell DustinCampbell left a comment

Choose a reason for hiding this comment

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

Looks good!

@@ -35,37 +36,26 @@ internal class ProjectState
private readonly object _lock;

private readonly IProjectEngineFactoryProvider _projectEngineFactoryProvider;
private readonly LanguageServerFeatureOptions _languageServerFeatureOptions;
private RazorProjectEngine? _projectEngine;

public static ProjectState Create(
Copy link
Member

Choose a reason for hiding this comment

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

💭 I suspect it's modeled on Roslyn's APIs like Compilation.

@davidwengier davidwengier merged commit 34cacfa into dotnet:main Nov 8, 2024
12 checks passed
@davidwengier davidwengier deleted the NerdSnipingMyselfForFuse branch November 8, 2024 00:27
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Nov 8, 2024
@jjonescz jjonescz modified the milestones: Next, 17.13 P2 Nov 25, 2024
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.

5 participants