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

LSP-pawnforge

by NiceFeatures ST4 New

Sublime Text LSP helper package for PawnForge (AMX Mod X Pawn Language Server)

Labels lsp, pawn, amxmodx

Details

Installs

  • Total 1
  • Win 0
  • Mac 1
  • Linux 0
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 Aug 31 Aug 30 Aug 29 Aug 28 Aug 27 Aug 26 Aug 25 Aug 24 Aug 23 Aug 22 Aug 21 Aug 20 Aug 19 Aug 18 Aug 17 Aug 16 Aug 15 Aug 14
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 1 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-pawnforge

Sublime Text helper package for PawnForge (AMX Mod X Pawn Language Server).

GitHub Release License Sublime Text 3 & 4

🖱️ Optional: Enable Ctrl + Click for Go to Definition

By default in Sublime Text, Ctrl + Click adds multi-cursors, while F12 goes to definition out of the box.

If you prefer **Ctrl + Click** to jump to definitions (like in VS Code), create or open: Preferences > Package Settings > LSP > Mouse Bindings (or Packages/User/Default (Windows).sublime-mousemap):

[
  {
    "button": "button1",
    "count": 1,
    "modifiers": ["ctrl"],
    "press_command": "drag_select",
    "command": "lsp_symbol_definition",
    "context": [
      {
        "key": "selector",
        "operator": "equal",
        "operand": "source.pawn, source.amxx, source.amxxpawn"
      }
    ]
  }
]

⌨️ Shortcuts & Navigation

Shortcut Action Notes
Ctrl + B Compile Plugin (amxxpc.exe) Built-in Sublime build system
F12 Go to Definition Native LSP shortcut
Shift + F12 Find All References Native LSP shortcut
Ctrl + Space Trigger Autocompletion AMXX 1.10 & ReAPI natives

💡 Tip for F9 (AMX-Studio style build): If you prefer **F9** to compile instead of Ctrl + B, add this to Preferences > Key Bindings (Packages/User/Default (Windows).sublime-keymap): json [ { "keys": ["f9"], "command": "pawn_build", "context": [{ "key": "selector", "operator": "equal", "operand": "source.pawn, source.amxx, source.amxxpawn" }] } ]


🌟 Overview

LSP-pawnforge integrates the PawnForge Language Server into Sublime Text using the official LSP package.

It brings enterprise-grade Pawn language intelligence to Sublime Text scripters with zero manual configuration: - ⚡ Auto-downloads the native language server binary (pawnforge-lsp.exe / pawnforge-lsp-linux) on first launch (no Node.js required!). - 🔄 Automatic updates: seamlessly manages server updates when new versions are released.


✨ Features

  • Instant Autocomplete: AMX Mod X 1.8.2 / 1.9 / 1.10 and ReAPI native functions with parameter hints and inline documentation.
  • Go to Definition (F12): Instant $O(1)$ navigation to functions, stocks, variables, and macros.
  • Find all References (Shift+F12): Project-wide search across .inc and .sma files with smart definition exclusion.
  • Hover Information: Hover over any symbol to inspect its prototype, parameters, tags, and documentation.
  • Smart String Callback Navigation: Jump to callbacks in set_task(1.0, "@Callback").
  • Workspace Symbols (Ctrl+T): Fuzzy symbol lookup across the entire workspace.
  • Document Highlight: Highlights all occurrences of the selected identifier.
  • Code Folding: Native code folding for #if/#endif, functions, and blocks.

🚀 Installation

Prerequisites

  1. In Sublime Text, open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P).
  2. Type Package Control: Install Package and press Enter.
  3. Install LSP (if not already installed).
  4. Install a Pawn syntax highlighting package so .sma and .inc files are recognized under the source.pawn scope:

Installing LSP-pawnforge

Option A: Package Control (Recommended)

  1. Open the Command Palette (Ctrl+Shift+P).
  2. Run Package Control: Install Package.
  3. Search for LSP-pawnforge and press Enter.

Option B: Manual Installation (Git Clone)

Clone this repository directly into your Sublime Text Packages directory:

Windows: “powershell cd ”$env:APPDATA\Sublime Text\Packages"

(or for Sublime Text 3: “$env:APPDATA\Sublime Text 3\Packages”)

git clone https://github.com/NiceFeatures/LSP-pawnforge.git

**Linux:**
```bash
cd ~/.config/sublime-text/Packages
git clone https://github.com/NiceFeatures/LSP-pawnforge.git

Restart Sublime Text and open any .sma or .inc file!


⚙️ Configuration

Opening Settings

You can open the PawnForge configuration at any time: - Menu: Preferences ➔ Package Settings ➔ LSP ➔ Servers ➔ LSP-pawnforge ➔ Settings - Command Palette (Ctrl+Shift+P): Type Preferences: LSP-pawnforge Settings and press Enter.

This opens the default settings on the left (read-only reference) and your user settings on the right (Packages/User/LSP-pawnforge.sublime-settings).


1. Include Paths Configuration

To add your AMX Mod X include folders (e.g. amxmodx.inc, cstrike.inc, ReAPI):

User Global Settings (Packages/User/LSP-pawnforge.sublime-settings)

{
  "settings": {
    "includePaths": [
      "include",
      "C:/HLDS/cstrike/addons/amxmodx/scripting/include"
    ]
  }
}

Per-Project Settings (your-project.sublime-project)

If you work with different server directories per project, define them inside your project file: “json { "folders”: [ { “path”: “.” } ], “settings”: { “LSP”: { “LSP-pawnforge”: { “settings”: { “includePaths”: [ “${project_path}/include”, “C:/HLDS/cstrike/addons/amxmodx/scripting/include” ] } } } } }

---

### 2. Available Settings Reference

| Setting | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `includePaths` | `array` | `["include"]` | List of paths to search for `.inc` files (workspace-relative or absolute). |
| `globalIncludePaths` | `array` | `[]` | Additional include directories applied globally across all projects. |
| `compiler.executablePath` | `string` | `""` | Path to `amxxpc.exe` compiler binary. |
| `compiler.includePaths` | `array` | `[]` | Include paths specifically passed to the compiler. |
| `compiler.options` | `array` | `[]` | Extra CLI options passed to compiler (e.g. `["-O2"]`). |
| `compiler.outputPath` | `string` | `""` | Directory where compiled `.amxx` binaries should be saved. |
| `language.reparseInterval` | `number` | `300` | Debounce delay in milliseconds before reparsing the file upon typing. |
| `language.webApiLinks` | `boolean` | `false` | Enable clickable links to AMX Mod X Web API docs in hover tooltips. |

---

## 📜 License
This project is licensed under the [GNU General Public License v3.0](LICENSE.txt).