[英]How can I get Visual Studio to source highlight .json source code?
How can I get VS to source highlight .json source code? 我怎样才能获得VS来源高亮.json源代码? I'd also like to have it have some of the same key-bindings that normal JavaScript enjoys.
我也想让它拥有一些普通JavaScript所享有的相同键绑定。 In a way all I'd really need/want is a way to have Visual Studio recognize a .json file as a .js file (I think).
在某种程度上,我真正需要/想要的是让Visual Studio将.json文件识别为.js文件(我认为)。 Is this possible?
这可能吗?
Try to use Visual Studio Extension TextHighlighter: 尝试使用Visual Studio扩展TextHighlighter:
VS 2010: TextHighlighterExtension VS 2010: TextHighlighterExtension
VS 2012: TextHighlighterExtension12 VS 2012: TextHighlighterExtension12
Great news! 好消息!
In CTP2 of Visual Studio 2013 Update 2 that was added a New JSON project item and editor 在Visual Studio 2013 Update 2的CTP2中添加了一个新的JSON项目项和编辑器
One more post New JSON editor features in Visual Studio 2013 Update 2 CTP2 在Visual Studio 2013 Update 2 CTP2中再发布一个新的JSON编辑器功能
Navigate starting at the top menu bar, 从顶部菜单栏开始导航,
TOOLS --> Options --> Text Editor --> File Extensions 工具 - >选项 - >文本编辑器 - >文件扩展名
Here you can add json
as an entry, however, the Script Editor
will not work at all, you can use Visual C++
editor experience which will provide very basic highlighting until Microsoft can get with the program and add some basic JSON support. 在这里,您可以添加
json
作为条目,但是, Script Editor
根本不起作用,您可以使用Visual C++
编辑器体验,这将提供非常基本的突出显示,直到Microsoft可以使用该程序并添加一些基本的JSON支持。
The problem is that a json file isn't valid javascript. 问题是json文件无效javascript。 (A file containing just a javascript literals without an assignment is invalid.) So while it will highlight, Visual Studio will be convinced your file's wrong, and (personally) I find that more annoying than the lack of highlighting.
(只包含没有赋值的javascript文字的文件是无效的。)因此,虽然它会突出显示,但Visual Studio将确信您的文件是错误的,并且(个人而言)我发现比缺少突出显示更烦人。
There is this project: http://jsonviewer.codeplex.com/ but that seems old and not currently maintained. 有这个项目: http : //jsonviewer.codeplex.com/但看起来很旧,目前还没有维护。 (Also it seems like it's just a visualizer, not a syntax highlighting plugin.)
(此外,它似乎只是一个可视化工具,而不是语法高亮插件。)
I'm currently look for a good plugin for this, or possibly writing one. 我目前正在寻找一个好的插件,或者可能写一个。
Into the menus Tools .. Options .. Text Editor .. File Extensions 进入菜单工具..选项..文本编辑器..文件扩展名
Add the JSON extension and choose to use the Script Editor 添加JSON扩展并选择使用脚本编辑器
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.