简体   繁体   English

VS2013中用于MicroTemplating的语法突出显示

[英]Syntax Highlighting in VS2013 for MicroTemplating

I am working on a project that uses client template rendering. 我正在使用客户端模板渲染的项目中。 I decided to use Micro-Templating engine. 我决定使用微模板引擎。

The problem is syntax highlighting feature of VS2013 corrupts my template codes. 问题是VS2013的语法高亮功能损坏了我的模板代码。 Other template engines, such as JSRender, can be recognised and highlighted well by Visual Studio Editor. Visual Studio编辑器可以很好地识别并突出显示其他模板引擎,例如JSRender。

http://i.stack.imgur.com/Jjt9g.png http://i.stack.imgur.com/Jjt9g.png

As you see, JSRender template highlighted well but VS didn't recognise my MicroTemplating template. 如您所见,JSRender模板突出显示得很好,但是VS无法识别我的MicroTemplating模板。 I copied this template example from http://ejohn.org/blog/javascript-micro-templating/ 我从http://ejohn.org/blog/javascript-micro-templating/复制了此模板示例

How can I make VS to recognise MicroTemplating templates like JSRender? 如何使VS识别MicroTemplating模板(如JSRender)? If there is not any option, can highlighting and automatic code fixing features of VS be disabled? 如果没有任何选项,可以禁用VS的突出显示和自动代码修复功能吗?

Thanks for your replies in advance. 感谢您的提前答复。

The problem is that you have a script block marked as type=html which causes the HTML editor/language service to come in to play within the block. 问题是您有一个标记为type = html的脚本块,这会导致HTML编辑器/语言服务在该块中播放。 There's no way to turn off the HTML editor inside blocks marked type=”text/html”. 无法关闭标记为type =“ text / html”的块内的HTML编辑器。

You could turn off HTML validation in Tools -> Options, but that only solves the warnings (eg green squiggles, Error List items). 您可以在“工具”->“选项”中关闭HTML验证,但这只能解决警告(例如绿色的花键,错误列表项)。 There's no way to control the formatting/highlighting. 无法控制格式/突出显示。

If this is something you'd like to see made available in a future update to the HTML language support in VS, you should log a request at http://visualstudio.uservoice.com so that others can vote on it and increase the likelihood that it will get picked up. 如果您希望以后在VS中对HTML语言支持进行更新时可以使用此功能,则应在http://visualstudio.uservoice.com上记录请求,以便其他人可以对此进行投票并增加可能性它将被捡起。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM