-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Remove Razor and editor inference document option providers #61091
Remove Razor and editor inference document option providers #61091
Conversation
@jasonmalinowski Does this look ok? |
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.
Besides some specific concerns, I admit I'm not seeing the big picture here. Sure, this gets rid of some document services, but seems like this just couples in a different way and I'm not sure what the goal is for that long term.
src/Workspaces/Core/Portable/Workspace/Host/DocumentService/Extensions.cs
Outdated
Show resolved
Hide resolved
@tmat: the compiler sure doesn't. 😉 |
This is still a workaround, for sure. It works better in the new options design though, where features do not use Long term we get the right options through LSP. |
6a047ed
to
de4064f
Compare
5202c1d
to
f2f0b8e
Compare
b66b174
to
4e0d019
Compare
} | ||
|
||
/// <summary> | ||
/// Provides editorconfig options for Razor design-time documents. |
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.
when do we need options on the razor design time documents? If they're asking us for formatting in razor, they should be p[assing the tabs/spaces/size options to us. If there are cases where we're not passing the options / using the passed in topions, is there a bug tracking it?
cc @NTaylorMullen
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.
Good question. I'm not entirely sure. I think there might cases when a Roslyn feature might trigger change in a Razor document.
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.
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.
Unfortunately I forget. @allisonchou do you recall?
// StructuredAnalyzerConfigOptions is defined in both Worksapce and Code Style layers. It is not public and thus can't be shared between these two. | ||
// However, Code Style layer is compiled against the shared Workspace APIs. The ProjectState creates and holds onto an instance | ||
// of Workspace layer's version of StructuredAnalyzerConfigOptions. This version of the type is not directly usable by Code Style code. | ||
// We create a clone of this instance typed to the Code Style's version of StructuredAnalyzerConfigOptions. |
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.
:( this codestyle stuff turns my brain into goo
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.
Yes. It's very complex. Hopefully after next few PRs it's gonna get a bit simpler.
4e0d019
to
a6d0e49
Compare
…o poison * upstream/features/required-members: (413 commits) [EE] Implement IDkmClrFullNameProvider2 in Roslyn's ResultProvider Formatter. (dotnet#60522) Remove parameter null-checking from the Language Feature Status list (dotnet#61302) Add pointer for `AnalysisLevel` to warning waves doc (dotnet#61196) Add an UWP OptProf test for IDE Add test Fix issue where we were getting a raw-string in a skipped token, causing a crash Fix several LSP completion kind mappings (dotnet#61243) Relax assertion in SyntheticBoundNodeFactory.Convert (dotnet#61287) Enable add usings on paste by default (dotnet#61299) Fix focus on rename UI opening (dotnet#60846) Update PublishData.json with new package Remove Razor and editor inference document option providers (dotnet#61091) Fix nested in generic type binding issues in enabled nullability context (dotnet#61182) Revert "Revert "Improve editorconfig options caching on ProjectState (dotnet#61131)" (dotnet#61216)" (dotnet#61283) Move MSBuild back to 16.5.0. Fix a few build and package issues (dotnet#61273) lint Revert workspaces msbuild changes. Use SegmentedHashSet<T> to eliminate LOH allocations in AsyncBatchingWorkQueue NRT ...
Follow up on #61054 and dotnet/razor#6338.
The idea is that instead of Razor providing formatting options for design-time documents using
IDocumentOptionsProvider
implement a Razor specificStructuredAnalyzerOptionsProvider
for the documents. This is a workaround until Razor switches all formatting logic to LSP.Similarly replaces
InferredIndentationDocumentOptionsProviderFactory
with a custom analyzer options provider. Also a workaround that should go away - tracked by #61109.The goal is to ultimately remove
IDocumentOptionsProvider
extensibility point.