-
Notifications
You must be signed in to change notification settings - Fork 196
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
Fix FUSE hook up in VS Code #11175
Conversation
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
@@ -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( |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
.
There was a problem hiding this 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( |
There was a problem hiding this comment.
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
.
This one might be a little controversial in terms of how I wired the
LanguageServerFeatureOptions
up through theProjectSnapshot
, but it's somewhat similar to how it works in cohosting, withRemoteProjectSnapshot -> 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 usingLanguageServerFeatureOptions
directly. It seems thatLanguageServerFlags
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. TheLanguageServerFeatureFlags
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.