Language Identifiers

Explore Agentic Development -

'; document.body.appendChild(div.children[0]); }

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:

  • Use the lowercased programming language name.
  • Search for other extensions in the Marketplace to find out if a language identifier has already been used.

Known language identifiers

The following table lists known language identifiers: