-
|
I didn't see a setting for that - is there a way to accomplish this? What's the nicest way of doing it if I know the file extension? is there a mapping somewhere from extensions to supported language? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Typically, the file extension will be the name or an alias of the corresponding language is Prism. For example, the const fileExtensionLangMap: Record<string, string | undefined> = {}
const getLanguage = (fileExtension) => {
return fileExtensionLangMap[fileExtension] ?? fileExtension
}
All extensions support all languages. Autocompletion has to be registered for each language, see the autocompletion guide. Automatic indentation and comment toggling also has to be imported for each language, see the language specific behavior guide. |
Beta Was this translation helpful? Give feedback.
Typically, the file extension will be the name or an alias of the corresponding language is Prism. For example, the
py,js,ts,cs,c,cpp,html,css,java,php,sql, and many more file extensions can be used as the code language directly. Any exceptions to this can be placed in a map, and then you fallback to the file extension. The code example below illustrates what I mean.All extensions support all languages. Autocompletion has to be registered…