Extensions
Add languages, toolchains and server runtimes as plain manifests from a git address or a local folder.
The app has no code specific to any language, language server or toolchain. A generic engine reads data instead, and an extension is a folder of that data: language, toolchain and server runtime manifests that add to or override the ones the app ships.
What the data says
| Kind | Format | What it holds |
|---|---|---|
| Package registry | Mason's registry, fetched and cached | Where to get each language server or tool and at which version: per-platform GitHub release files, direct downloads, or package managers such as npm, PyPI, Go and cargo |
| Language manifest | TOML | File extensions, line comment, highlighter grammar, LSP id, the default server from the registry, its arguments and settings, the toolchains it needs and its file templates |
| Toolchain manifest | TOML | An SDK or runtime: its program, how to ask it for its version and which minimum is needed, the usual install locations, how to fetch and check it, and the package managers and runners that come with it |
A language or package-manager kind that the registry or a manifest describes needs no code.
A language manifest
This is the Rust entry of the manifests the app ships:
[[language]]
id = "rust"
name = "Rust"
extensions = ["rs"]
line_comment = "//"
grammar = "rust"
syntax = "rust"
server = "rust-analyzer"A language can also declare file templates, offered by the file tree's New menu when no language server of the folder offers its own:
[[language.templates]]
id = "component"
label = "React component"
group = "TypeScript"
file = "{{name}}.tsx"
body = "export function {{name}}() {\n return <div>$0</div>;\n}\n"
markers = ["package.json", "tsconfig.json"]Add an extension
Open Settings › Languages
The Extensions section lists the extensions you added.
Add it
Enter the git address of an extension, or choose a local folder of manifests, and add it. A git extension is cloned with git into the extensions folder of the config folder; a local folder is read where it is.
From the same list you can update or remove an extension. Manifests of your own, outside any extension, go in the manifests folder of the config folder.
A trusted extension's manifests decide which programs the app downloads and starts as language servers. Add extensions only from sources you trust.
Where things are installed
- Language servers and private server runtimes go into the app's own folder, here or on the remote host of the environment.
- On a remote host, servers are installed by running the manifest's install there, after asking, and shared by package and version.
- The app never installs a project's toolchain. See Language servers.