Change syntax coloring for a file extension in Visual Studio 2013

让人想犯罪 __ 提交于 2020-01-06 02:41:32

问题


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.

Thanks


回答1:


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.



来源:https://stackoverflow.com/questions/27805000/change-syntax-coloring-for-a-file-extension-in-visual-studio-2013

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!