Skip to main content
Visual Studio Code provides rich language support through a combination of built-in features and extensible language servers. This architecture enables everything from syntax highlighting to intelligent code completion across dozens of programming languages.

How Language Support Works

VS Code’s language support is built on several key components:
1

Syntax Highlighting

TextMate grammars provide tokenization and syntax coloring for source code. Each language extension includes a .tmLanguage.json file that defines the grammar rules.
2

Language Configuration

Language configuration files define comment styles, bracket pairs, auto-closing behavior, and indentation rules specific to each language.
3

Language Features

Advanced features like IntelliSense, code navigation, and refactoring are powered by language servers following the Language Server Protocol (LSP).
4

Extension API

VS Code exposes a comprehensive Extension API that allows language extensions to register providers for completions, diagnostics, formatting, and more.

Built-in Language Support

VS Code ships with built-in support for the following languages in the extensions/ directory:

Programming Languages

JavaScript & TypeScript

Full-featured support including IntelliSense, debugging, refactoring, and task running. Powered by the TypeScript language service.

Python

Syntax highlighting with MagicPython grammar. Enhanced features available through the Python extension.

Markdown

Preview, validation, IntelliSense for links and headers, and integrated notebook rendering.

Additional Built-in Languages

VS Code includes syntax support for:
  • Web: HTML, CSS, SCSS, LESS, JSON, XML
  • Systems: C/C++, C#, Java, Go, Rust
  • Scripting: Python, Ruby, Perl, Lua, Shell Script, PowerShell, Batch
  • JVM: Java, Groovy, Scala
  • .NET: C#, F#, VB
  • Functional: Clojure, F#
  • Data: SQL, YAML, TOML, INI
  • Markup: Markdown, LaTeX, reStructuredText
  • Other: Dockerfile, Makefile, R, Julia, Swift, Dart

Language Configuration Structure

Every language extension defines its capabilities through a package.json contribution:
{
  "contributes": {
    "languages": [
      {
        "id": "javascript",
        "aliases": ["JavaScript", "javascript", "js"],
        "extensions": [".js", ".es6", ".mjs", ".cjs"],
        "configuration": "./language-configuration.json"
      }
    ],
    "grammars": [
      {
        "language": "javascript",
        "scopeName": "source.js",
        "path": "./syntaxes/JavaScript.tmLanguage.json"
      }
    ]
  }
}
The language-configuration.json file defines language-specific editor behavior like comment styles, bracket matching, and auto-indentation rules.

Language Features API

Language extensions can provide intelligent features through VS Code’s provider API:
FeatureProviderPurpose
IntelliSenseCompletionItemProviderCode completion suggestions
DiagnosticsDiagnosticCollectionError and warning reporting
HoverHoverProviderType information on hover
Signature HelpSignatureHelpProviderParameter hints
Go to DefinitionDefinitionProviderNavigate to symbol definitions
Find ReferencesReferenceProviderFind all symbol references
RenameRenameProviderIntelligent symbol renaming
FormattingDocumentFormattingEditProviderCode formatting
Code ActionsCodeActionProviderQuick fixes and refactorings

Language Server Protocol

Many advanced language features are implemented using the Language Server Protocol (LSP), which separates language analysis from the editor:
// Language server runs in a separate process
// Communicates with VS Code via JSON-RPC
const serverOptions: ServerOptions = {
  run: { module: serverModule, transport: TransportKind.ipc },
  debug: { module: serverModule, transport: TransportKind.ipc }
};

const client = new LanguageClient(
  'languageServerId',
  'Language Server Name',
  serverOptions,
  clientOptions
);
The LSP architecture allows the same language server to be reused across different editors, reducing development effort and improving consistency.

Extension Categories

Language extensions in VS Code fall into several categories:

Basic Language Support

Provides syntax highlighting and basic editor features through grammar and configuration files. Examples: Batch, Dockerfile, INI.

Language Features Extensions

Add intelligent features like IntelliSense and diagnostics. Examples:
  • typescript-language-features - JavaScript/TypeScript support
  • markdown-language-features - Markdown preview and validation
  • html-language-features - HTML IntelliSense
  • json-language-features - JSON schema validation

Debugger Extensions

Provide debugging capabilities through the Debug Adapter Protocol. Built-in examples:
  • debug-auto-launch - Auto-attach Node.js debugging
  • debug-server-ready - Open browser when server is ready

Semantic Tokens

Modern language extensions can provide semantic highlighting that goes beyond syntax-based coloring:
{
  "semanticTokenScopes": [
    {
      "language": "javascript",
      "scopes": {
        "property": ["variable.other.property.js"],
        "function": ["entity.name.function.js"],
        "variable.readonly": ["variable.other.constant.object.js"]
      }
    }
  ]
}
Semantic tokens provide context-aware coloring based on the language’s type system rather than just pattern matching.

Creating Language Support

To add support for a new language:
1

Create Language Extension

Use yo code to scaffold a new language extension with grammar and configuration files.
2

Define Grammar

Create a TextMate grammar (.tmLanguage.json) for syntax highlighting.
3

Configure Language Behavior

Set up language-configuration.json with brackets, comments, and auto-closing rules.
4

Add Language Features

Implement providers for IntelliSense, diagnostics, and other features using the Extension API or by creating a language server.

Configuration Defaults

Language extensions can set default editor configurations for their language:
{
  "configurationDefaults": {
    "[javascript]": {
      "editor.maxTokenizationLineLength": 2500
    },
    "[python]": {
      "diffEditor.ignoreTrimWhitespace": false,
      "editor.defaultColorDecorators": "never"
    }
  }
}

Next Steps

Explore detailed documentation for specific languages:
All built-in language extensions are open source and available in the VS Code repository under extensions/.

Build docs developers (and LLMs) love