Remove Razor and editor inference document option providers#61091
Remove Razor and editor inference document option providers#61091tmat merged 5 commits intodotnet:mainfrom
Conversation
|
@jasonmalinowski Does this look ok? |
jasonmalinowski
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.
:( this codestyle stuff turns my brain into goo
There was a problem hiding this comment.
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
IDocumentOptionsProviderimplement a Razor specificStructuredAnalyzerOptionsProviderfor the documents. This is a workaround until Razor switches all formatting logic to LSP.Similarly replaces
InferredIndentationDocumentOptionsProviderFactorywith a custom analyzer options provider. Also a workaround that should go away - tracked by #61109.The goal is to ultimately remove
IDocumentOptionsProviderextensibility point.