CSHTML-files support
Alex-Sokolov opened this issue · 1 comments
Alex-Sokolov commented
Installed product versions
- Visual Studio: 2015 Enterprise
- This extension: 1.0.19
Description
Is it planned to add prettier-option for cshtml-files, which contain <script>
tag?
Steps to recreate
- Open cshtml-file with javascript block
- Trying to prettify code
Current behavior
No way to do it
Expected behavior
Formatting code in file
jesperbjensen commented
It would be nice if it could work, but it will be a hard problem:
- Prettier does support formatting “strings of content” - but you have extra indentation that the plugin would then need to insert back. (Because your script tag is indented)
- You can have C# code in your script tags - prettier does not support this.
- We need to parse your cshtml file to find your script tags.
If someone wants to try out if it could work - then they are very welcome - but I think it’s no easy task.
Perhaps an easier thing would be to implement a “format selection” functionality instead.