问题描述
我有真的包含JSON数据的file1.cshtml。我想语法高亮等,以反映这一点。我试着去工具>选项>文本编辑器>文件扩展名,改变了CSHTML扩展的编辑体验是JSON编辑器。然后,我关闭并重新打开Visual Studio中,但我的编辑器没有显示所需的语法高亮。我可以复制和file1.cshtml的内容粘贴到file2.json,一切看起来不错,但我宁愿没有做这种方式。我使用Visual Studio 2013 premium。改变文件扩展名是不是一种选择。
I have a file1.cshtml that really contains JSON data. I'd like the syntax highlighting, etc. to reflect this. I tried going to Tools > Options > Text Editor > File Extension and changed the cshtml extension's Editing Experience to be JSON Editor. I then closed and reopened Visual Studio, but my editor isn't showing the desired syntax highlighting. I can copy and paste the contents of file1.cshtml into file2.json and everything looks ok, but I'd rather not have to do it this way. I'm using Visual Studio 2013 Premium. Changing the file extension is not an option.
感谢
推荐答案
我发现至少部分回答我的问题。右键单击在Visual Studio中以.json文件,选择打开方式。在出现的选择JSON编辑器,单击对话框中的设置为默认值,然后选择确定。
I've found at least a partial answer to my question. Right click on the .json file in Visual Studio, choose Open with. In the dialog that appears, choose JSON Editor, and click "Set as Default," then choose OK.
这篇关于更改语法着色在Visual Studio 2013的文件扩展名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!