ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

LSP-Forge

by forge-language ST4 New

Forge language support for Sublime Text: syntax, build commands and LSP integration

Labels lsp, forge

Details

Installs

  • Total 0
  • Win 0
  • Mac 0
  • Linux 0
Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4 Sep 3 Sep 2 Sep 1
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

LSP-Forge

Forge language-server integration for Sublime Text 4 (build 4132 or newer), licensed under Apache 2.0.

This package uses Sublime LSP's LspPlugin API for diagnostics, completion, hover and document symbols. Install the independent Forge syntax package, LSP, and a Forge language server. Syntax highlighting, snippets and build commands belong to Forge, which works without LSP.

Upgrade from 0.1.0

Install Forge before upgrading to 0.2.2; syntax and editor resources have moved out of LSP-Forge. If your project configures an LSP client under the old name forge, rename that client key to LSP-Forge. Define compiler options as dotted keys in initialization_options. Move any overrides from settings.forge or initialization_options.forge to these keys (for example, "forge.path"), then remove the old nested forge object. Remove any old unpacked development copy before installing the new archive.

Install

Package Control repository

Until the package is accepted into the default channel, run Package Control: Add Repository and enter:

https://raw.githubusercontent.com/forge-language/sublime-text/main/packages.json

Then run Package Control: Install Package and select LSP-Forge. Install LSP and the separate Forge syntax package as well. GitHub version tags provide subsequent package updates.

Release file

Download LSP-Forge.sublime-package and its SHA-256 file from GitHub Releases. Verify the checksum and place the archive, without unzipping it, in Sublime Text's Installed Packages folder. Locate this folder by opening Preferences > Browse Packages… and navigating to the adjacent Installed Packages directory. Restart Sublime Text after installation.

Do not keep both an unpacked Packages/LSP-Forge development copy and an installed archive: the unpacked copy takes precedence. Manual installations must be updated manually; Package Control installations track release tags.

Language server

  1. Install the Forge SDK for a supported compiler platform.
  2. Build/install forge-lsp using the language-server native instructions.
  3. Install LSP through Package Control.
  4. Put forge-lsp and forge on Sublime Text's PATH, or set absolute paths in Preferences: LSP-Forge Settings.

If LSP was installed after LSP-Forge, restart Sublime Text to load the integration.

Sublime Text launched from the desktop may have a different PATH than a terminal. For example:

{
  "command": ["/absolute/path/to/forge-lsp"],
  "initialization_options": {
    "forge.path": "/absolute/path/to/forge",
    "forge.includePaths": ["/absolute/path/to/project/modules"]
  }
}

Configure compiler options with forge.path, forge.includePaths, forge.forgeRoot and forge.libDir inside initialization_options. Override only the options you need; the other defaults are preserved. Sublime LSP expands these dotted keys into the nested forge object that both servers read at startup. Restart the server after changing compiler settings. Optional forge.forgeRoot and forge.libDir support custom toolchain layouts. The default settings file includes comments explaining each option. Settings are also available under Preferences > Package Settings > LSP > Servers > LSP-Forge. The default command is forge-lsp; no server is downloaded or built automatically.

The separately built TypeScript server is also supported:

{
  "command": ["/absolute/path/to/node", "/absolute/path/to/language-server/out/server.js", "--stdio"]
}

Build it with npm ci && npm run build in the language-server repository, using Node.js 18 or newer. This is an alternative to the native server, not a bundled npm dependency.

The separate Forge syntax package is platform independent. Compiler/server availability depends on their supported platforms; the current public Forge SDK targets Linux x86-64 with glibc 2.35 or newer.

Develop and release

python3 -m unittest discover -s tests -p 'test_*.py' -v
python3 scripts/build-package.py
python3 scripts/test-sublime.py --sublime /path/to/sublime_text/sublime_text \
  --syntax-archive ../sublime-syntax/dist/Forge.sublime-package \
  --fixture ../sublime-syntax/tests/syntax_test_forge.fg

The build writes dist/LSP-Forge.sublime-package and its SHA-256 file from an explicit resource list with fixed archive timestamps. Development scripts, tests, credentials and caches are excluded. See scripts/test-sublime.py for isolated real-editor checks; the syntax fixture is maintained in the independent syntax repository.

Main/PR CI validates and builds the archive. Pushing a semantic version tag such as v0.2.2 runs validation and publishes a GitHub Release with the package and checksum. Default-channel submission follows Package Control's submission process.