dotnet / razor

Compiler and tooling experience for Razor ASP.NET Core apps in Visual Studio, Visual Studio for Mac, and VS Code.
https://asp.net
MIT License
491 stars 190 forks source link

Sub-sub languages with multiple language servers don't work in VS #4559

Open NTaylorMullen opened 4 years ago

NTaylorMullen commented 4 years ago

How Razor currently re-invokes requests on sub-language documents wont work as-is when things like CSS / JS in Razor are implemented. The reason being is we depend on a general "RequestAsync" method from the LSP platform calling through to all potential languages and "doing the right thing" however, given it's a general LSP request invocation mechanism it can't possibly (without special casing) know how to aggregate certain requests such as completion.

Therefore, when we invoke "completion" on the sub-HTML language document it grabs the first language client it finds. We need to start calling into the platform specific APIs for each experience (completion/hover etc.). VS plans to make these available in the future; however, for the interim we'll need to build a way to use these ahead of time or forego sub-CSS/JS support.

/cc @ToddGrun @jimmylewis @alexgav big FYI

NTaylorMullen commented 4 years ago

If we utilize the ILanguageClient specific RequestAsync method like LiveShare we can build our own aggregate API until VS supports theirs