Skip to content

Latest commit

 

History

History
90 lines (67 loc) · 3.11 KB

File metadata and controls

90 lines (67 loc) · 3.11 KB

Sublime Text

Setup guide for using BGforge MLS with Sublime Text.

Prerequisites

pnpm install -g @bgforge/mls-server

Install the LSP package via Package Control.

File types and syntax highlighting

Download bgforge-mls.tmbundle.zip from the latest GitHub release, extract it, and copy the .tmLanguage.json files from bgforge-mls.tmbundle/Syntaxes/ into Packages/User/ (accessible via Preferences > Browse Packages...). Restart Sublime Text.

This provides both file type detection and syntax highlighting. If you only need LSP features without highlighting, create minimal .sublime-syntax stubs instead:

SSL.sublime-syntax:

%YAML 1.2
---
name: Fallout SSL
file_extensions: [ssl, h]
scope: source.fallout-ssl
contexts:
    main: []

Repeat for each language (weidu-baf/baf, weidu-d/d, weidu-tp2/tp2 tpa tph tpp, fallout-worldmap-txt/no extension).

The tmbundle also includes highlight-only definitions (no LSP provider) for Fallout MSG (.msg), WeiDU TRA (.tra), Infinity 2DA (.2da), and Fallout scripts.lst.

For worldmap.txt, use View > Syntax > Fallout Worldmap manually since syntax files match by extension, not filename.

Note: .h files default to C in Sublime Text. The config above overrides this globally. Remove h from the list if you also work with C headers.

Language server

Open Preferences > Package Settings > LSP > Settings and add:

{
    "clients": {
        "bgforge-mls": {
            "enabled": true,
            "command": ["bgforge-mls-server", "--stdio"],
            "selector": "source.fallout-ssl | source.weidu-baf | source.weidu-tp2 | source.weidu-d | source.fallout-worldmap-txt"
        }
    }
}

TypeScript plugins (TSSL/TD)

If you write .tssl or .td transpiler files, the server package includes TypeScript plugins that run inside tsserver. See TypeScript Plugins for setup.

Settings

Open Preferences > Package Settings > LSP > Settings and add settings under the client configuration:

{
    "clients": {
        "bgforge-mls": {
            "enabled": true,
            "command": ["bgforge-mls-server", "--stdio"],
            "selector": "source.fallout-ssl | source.weidu-baf | source.weidu-tp2 | source.weidu-d | source.fallout-worldmap-txt",
            "settings": {
                "bgforge.validate": "saveAndType",
                "bgforge.falloutSSL.compilePath": "",
                "bgforge.falloutSSL.compileOptions": "-q -p -l -O2 -d -s -n",
                "bgforge.falloutSSL.outputDirectory": "",
                "bgforge.falloutSSL.headersDirectory": "",
                "bgforge.weidu.path": "weidu",
                "bgforge.weidu.gamePath": ""
            }
        }
    }
}

See Settings Reference for all available options.