Language Identifiers

In Visual Studio Code, each language mode has a unique specific language identifier. That identifier is rarely seen by the user except in the settings, for example, when associating file extensions to a language:

    "files.associations": {
        "*.myphp": "php"
    }

Note that casing matters for exact identifier matching ('Markdown' != 'markdown')

The language identifier becomes essential for VS Code extension developers when adding new language capabilities or when replacing a language support.

Every language defines its id through the languages configuration point in the extension's package.json file:

    "languages": [{
        "id": "java",
        "extensions": [ ".java", ".jav" ],
        "aliases": [ "Java", "java" ]
    }]

Language supports are added using the language identifier:

    "grammars": [{
        "language": "groovy",
        "scopeName": "source.groovy",
        "path": "./syntaxes/Groovy.tmLanguage.json"
    }],
    "snippets": [{
        "language": "groovy",
        "path": "./snippets/groovy.json"
    }]
languages.registerCompletionItemProvider('php', new PHPCompletionItemProvider(), '.', '$')

New identifier guidelines

When defining a new language identifier, use the following guidelines:

Known language identifiers

The following table lists known language identifiers:

Language Identifier
ABAP abap
Windows Bat bat
BibTeX bibtex
Clojure clojure
Coffeescript coffeescript
C c
C++ cpp
C# csharp
CSS css
Diff diff
Dockerfile dockerfile
F# fsharp
Git git-commit and git-rebase
Go go
Groovy groovy
Handlebars handlebars
HTML html
Ini ini
Java java
JavaScript javascript
JavaScript React javascriptreact
JSON json
JSON with Comments jsonc
LaTeX latex
Less less
Lua lua
Makefile makefile
Markdown markdown
Objective-C objective-c
Objective-C++ objective-cpp
Perl perl and perl6
PHP php
Plain Text plaintext
PowerShell powershell
Pug jade
Python python
R r
Razor (cshtml) razor
Ruby ruby
Rust rust
SCSS scss (syntax using curly brackets), sass (indented syntax)
ShaderLab shaderlab
Shell Script (Bash) shellscript
SQL sql
Swift swift
TypeScript typescript
TypeScript React typescriptreact
TeX tex
Visual Basic vb
XML xml
XSL xsl
YAML yaml