Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

V1 Built-in Extensions

Built-in extensions use hone-extension.json manifests and ship with the IDE binary. They are loaded by the ExtensionRegistry in hone-core.

Manifest Structure

Each extension lives in its own directory under extensions/<lang>/ and is defined by a hone-extension.json file:

{
  "id": "hone.typescript",
  "name": "TypeScript",
  "version": "1.0.0",
  "publisher": "hone",
  "description": "TypeScript and JavaScript language support",
  "license": "MIT",
  "engines": { "hone": ">=1.0.0" },
  "main": "src/index.ts",
  "activationEvents": [
    "onLanguage:typescript",
    "onLanguage:javascript",
    "onLanguage:typescriptreact",
    "onLanguage:javascriptreact"
  ],
  "contributes": {
    "languages": [
      {
        "id": "typescript",
        "aliases": ["TypeScript", "ts"],
        "extensions": [".ts", ".mts", ".cts"],
        "configuration": "./language-configuration.json"
      }
    ],
    "lspServers": [
      {
        "id": "typescript-language-server",
        "command": "typescript-language-server",
        "args": ["--stdio"],
        "languages": ["typescript", "javascript", "typescriptreact", "javascriptreact"]
      }
    ],
    "commands": [],
    "snippets": [],
    "configuration": {},
    "keybindings": []
  }
}

Manifest Fields

FieldRequiredDescription
idYesUnique identifier (convention: hone.<language>)
nameYesDisplay name
versionYesSemver version string
publisherYesPublisher identifier
descriptionYesShort description
licenseYesSPDX license identifier
engines.honeYesMinimum compatible Hone version
mainNoEntry point file (if extension has runtime code)
activationEventsYesEvents that trigger extension loading

Contribution Points

The contributes object declares what the extension provides:

  • languages – Language definitions with file extensions, aliases, and configuration
  • lspServers – LSP server configurations (command, args, supported languages)
  • commands – Commands registered in the command palette
  • snippets – Code snippets for the language
  • configuration – Settings the extension exposes
  • keybindings – Default keyboard shortcuts

Walkthrough: Adding a New Language

  1. Create a directory: extensions/<lang>/
  2. Create hone-extension.json with the language metadata
  3. Define language contributions: file extensions, aliases, language configuration
  4. Configure an LSP server if one exists (specify the command, args, and supported language IDs)
  5. Add commands, snippets, and keybindings as needed
  6. Register the extension in the extension system

Language Configuration

The language-configuration.json file controls editor behavior for the language:

{
  "comments": {
    "lineComment": "//",
    "blockComment": ["/*", "*/"]
  },
  "brackets": [
    ["{", "}"],
    ["[", "]"],
    ["(", ")"]
  ],
  "autoClosingPairs": [
    { "open": "{", "close": "}" },
    { "open": "[", "close": "]" },
    { "open": "(", "close": ")" },
    { "open": "\"", "close": "\"" },
    { "open": "'", "close": "'" }
  ],
  "surroundingPairs": [
    ["{", "}"],
    ["[", "]"],
    ["(", ")"],
    ["\"", "\""],
    ["'", "'"]
  ]
}

Existing Built-in Extensions

ExtensionLanguagesLSP Server
TypeScriptTypeScript, JavaScript, TSX, JSXtypescript-language-server
PythonPythonpylsp or pyright
RustRustrust-analyzer
GoGogopls
C++C, C++, Objective-Cclangd
HTML/CSSHTML, CSS, SCSS, Lessvscode-html-languageserver
JSONJSON, JSONCvscode-json-languageserver
MarkdownMarkdown
DockerDockerfile, Docker Compose
TOML/YAMLTOML, YAML
GitGit commit, Git rebase, .gitignore