Closed 9swampy closed 7 years ago
That is a bug for the JavaScript team to fix in VS. @billti is this a known issue that Format Document doesn't work in <script>
blocks in a .vue file? This extension maps .vue files to the HTML editor
@jramsay would be the most knowledgeable here. Jason, any idea?
@madskristensen (cc @billti): tested it out and it looks like it is more than just formatting that isn't working in .vue files. None of the JS language service features are working except classification as this uses textmate. This is due to an InvalidOperationException when we attempt to add the document in Roslyn. This occurs because Roslyn is unable to determine the host type for the document. For other HTML editor files (.html, .ascx, .aspx) the ContentType is HTML:
example: ASPX
For the .vue file however the ContentType is Vue
Not sure where you set this but if you can make it match the other HTML editor content types it should work.
Alternatively, Steve Dower has this PR out on the Roslyn side that might fix the issue here as well. Not sure when this fix is targeted for though: https://github.com/dotnet/roslyn/pull/17221
Fixed
Works for me, great stuff. Thanks for listening :)
First of all, good work: appreciated. However HTML gets formatted fine but the Javascript doesn't. Any plans?