Does anybody know how to get VS 2010 to use the same highlighting for a file called .JSON as it uses for a JavaScript file? Just working on a client site and they've named all their JSON template files as .JSON, with the result that I just get a plain old text editor when I open it in Visual Studio. Any suggestions? I'm sure there must be an option somewhere that would do it but I can't find it so far...
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Tools -> Options -> Text Editor -> File Extension
End your extension 'json' and select 'Script Editor' and click 'add'.
Re-open any json documents for it to take affect.
回答2:
Another option is to use Text Highlighter (extention for Visual Studio 2010), which offers syntax highlighting for the following text formats:
- .json (also offer syntax validation)
- .bat
- .cmd
- .ini
- .txt
- .log
回答3:
Great news!
In CTP2 of Visual Studio 2013 Update 2 that was added a New JSON project item and editor