是否可以将给定的语言与 VSCode 中的文件扩展名相关联? [英] Is it possible to associate a given language with a file extension in VSCode?

查看:38
本文介绍了是否可以将给定的语言与 VSCode 中的文件扩展名相关联?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前是否可以将给定的语言与通常与该语言无关的文件扩展名相关联?

Is it currently possible to associate a given language with a file extension that is not typically associated with that language?

假设我有一个文件类型 *.foo,我想将它与 JavaScript 关联以进行语法高亮显示.有谁知道目前使用 VSCode 是否可行?

Say I have a filetype *.foo, and I want to associate it with JavaScript for syntax highlighting. Does anyone know if this is currently possible with VSCode?

我正在使用一种在语法上类似于 Visual Basic 的语言,并希望将其与该语言类型相关联.我知道您可以在打开文件后指定语言,但是每次打开文件时都这样做很麻烦.

I am working in a language that is syntactically similar to Visual Basic, and want to associate it with that language type. I understand that you can assign a language after the file is opened, however this is cumbersome to do each time a file is opened.

例如,在 Sublime Text 中,可以选择以当前扩展名打开所有内容...".这对于 VSCode 来说还存在吗?

In Sublime Text for example it is possible to select "Open all with current extension as...". Does this exist yet for VSCode?

Visual Studio Code 团队添加了一种适当的方法来添加主题和语言.

The Visual Studio Code team has added a proper way to add both themes and languages.

https://code.visualstudio.com/更新#_yo-code-streamlined-customizations-for-vs-code

推荐答案

这个问题的答案有更新,所以想更新一下.

There is an update to the answer of this question, so I wanted to update it.

Visual Studio Code 团队发布了一种使用带有 TextMate tmBundles 的 Yeoman 生成器向应用程序添加新语言和主题的正确方法,此处记录:

The Visual Studio Code team released a proper way to add new Languages and Themes to the application using a Yeoman generator with TextMate tmBundles which is documented here:

https://code.visualstudio.com/更新#_yo-code-streamlined-customizations-for-vs-code

这里:https://code.visualstudio.com/updates#_customization-adding-language-colorization-bracket-matching

这篇关于是否可以将给定的语言与 VSCode 中的文件扩展名相关联?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆