Contents

Build a language pack

In this page you start a language pack, give the code map and the editor what they need for your language, and load it into your own Jacker.

Before you begin

  • Build the author kit. See The author kit.
  • Have a tree-sitter grammar for your language, built for WebAssembly (a .wasm file). The tree-sitter CLI builds one with tree-sitter build --wasm.
  • Start Jacker with JACKER_PLUGINS=1 pnpm desktop:dev from the jacker repository.

Create the plugin

  1. Create a starter plugin. Replace PUBLISHER with your publisher name and LANG with your language’s id:
    shell
    jacker-plugin init language ./LANG --id PUBLISHER.LANG
    The starter contains:
    • plugin.json: the manifest, with one language whose extension is .LANG.
    • grammars/tree-sitter-LANG.wasm: an empty placeholder grammar.
    • grammars/tags.scm and grammars/imports.scm: query files for the code map, with examples in comments.
    • syntax/LANG.monarch.json: editor colouring.
  2. Replace the placeholder grammar with your own .wasm file, keeping the name or updating codemap.grammar in plugin.json.
  3. In plugin.json, set extensions to your language’s file extensions.
  4. Write grammars/tags.scm against your grammar’s node names. See Code map queries.
  5. Adjust syntax/LANG.monarch.json. See Editor colouring with Monarch.
  6. Check the plugin:
    shell
    jacker-plugin validate ./LANG

Load it and check the result

  1. In Jacker, open Plugins, and on the Installed tab click Load local plugin…. Choose the plugin folder.
  2. Open a file with your extension in the Code view. Confirm that it’s coloured.
  3. Open the Map view. Confirm that your file’s symbols appear after the next index run.

If the plugin shows Failing, its reason names what’s wrong, such as a missing file. If a query doesn’t compile against your grammar, Jacker’s log records “plugin language unavailable in the code map” with the error, and that language is skipped in the code map.

Add a language server

A language server gives the editor completions, diagnostics, and go-to-definition. To add one:

  1. Declare the server program under programs. A server that ships as a binary for each platform is a binary program; one written for Node is a node program. See The plugin.json manifest.
  2. Name it in the language’s server:
    json
    "server": {
      "program": "LANG_SERVER",
      "args": ["--stdio"],
      "rootMarkers": ["build.LANG"]
    }
    Replace LANG_SERVER with the program’s key under programs.

A plugin’s language server runs only in trusted projects. It can add a server for a language Jacker has no server for; if your language uses an extension that has a built-in server (.ts, .js, .py, .dart, and related extensions), the built-in server is used.

What’s next

We use only essential cookies to keep you signed in and the app working. With your consent we may enable optional analytics to help us improve e-volv. See our Privacy Policy and Terms.