-
Notifications
You must be signed in to change notification settings - Fork 191
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
Razor LSP generates ~~ filler for comments in HTML documents, creates syntax errors in contained languages #7891
Comments
The content of the change sent to the HTML LSP is like this:
You can see how the |
Yeah, this is annoying. We rewrite all non-Html to be |
Could we just stop doing that? It seems like an odd experience. |
@NTaylorMullen any chance you recall why it wasn't filled in with spaces? Was there a need to have a non-whitespace filler? |
Formatting would absolutely fall on the floor if we used whitespace, as you'd remove most of it I suspect. The solution here, for now, is to use CSS comments, and if you don't want the comments to be in the HTML file, then put your Razor comments in the CSS comment. The real solution will be full on source mapping for Html generated documents, like we have for C#, which will enable us to remove workarounds like #6597 (which is also coming soon to code actions) and fix other issues like #7564 |
Yup what @davidwengier said ^ 😄 |
Razor comments can also cause problems for TypeScript: https://developercommunity.visualstudio.com/t/Razor-comment-in-cshtml-cause-go-to-def/10368814 |
Another report, where this actually causes all TypeScript functionality to break due to the server crashing: https://developercommunity.visualstudio.com/t/Intellisense-gives-Error-processing-requ/10440137 |
microsoft/TypeScript#55687 is the issue tracking a fix to prevent the TypeScript compiler from crashing. |
Originally posted by @Heshyo in #7349 (comment)
The text was updated successfully, but these errors were encountered: