LSP-pawnforge
Sublime Text LSP helper package for PawnForge (AMX Mod X Pawn Language Server)
Links
Versions
1.0.4
(>ST4000)
·
LSP-pawnforge
Sublime Text helper package for PawnForge (AMX Mod X Pawn Language Server).
🖱️ 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
F9to compile instead ofCtrl + B, add this toPreferences > Key Bindings(Packages/User/Default (Windows).sublime-keymap):[ { "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.incand.smafiles 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
- In Sublime Text, open the Command Palette (
Ctrl+Shift+P/Cmd+Shift+P). - Type
Package Control: Install Packageand press Enter. - Install
LSP(if not already installed). - Install a Pawn syntax highlighting package so
.smaand.incfiles are recognized under thesource.pawnscope:- Pawn syntax (by Southclaws, available directly in Package Control), or
- sublime-pawn-syntax (custom AMX Mod X & ReAPI syntax).
Installing LSP-pawnforge
Option A: Package Control (Recommended)
- Open the Command Palette (
Ctrl+Shift+P). - Run
Package Control: Install Package. - Search for
LSP-pawnforgeand press Enter.
Option B: Manual Installation (Git Clone)
Clone this repository directly into your Sublime Text Packages directory:
Windows:
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:
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): TypePreferences: LSP-pawnforge Settingsand 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:
{
"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.