LinuxCNC LSP — smart editing + live error-checking for HAL, INI and G-code (VS C

More
31 May 2026 14:42 #346803 by pesto
**TL;DR:** I built a free, open-source (GPL) language server that gives you autocomplete, hover docs, go-to-definition and *live error checking* for your `.hal`, `.ini` and `.ngc` files — so config mistakes show up as red squiggles in your editor instead of as a cryptic failure when you start LinuxCNC.

Marketplace: marketplace.visualstudio.com/items?itemN...erStolz.linuxcnc-lsp

We all know the drill: you tweak a HAL file, start the machine, and it dies with an error about a pin that doesn't exist — because you typed `parport.0.pin-02-ot` instead of `-out`. Or a signal silently does nothing because nothing actually writes to it. This catches that stuff *while you type.*

**What it catches for you (HAL):**
- Unknown components and **misspelled pin/parameter names** (it knows 214 HAL components, 2,153 pins, 589 parameters)
- **Signals with no writer, no reader, or two writers** fighting over one signal
- **Type conflicts** — linking a `bit` pin to a `float` signal
- **`setp` on a read-only parameter**
- It actually understands `count=`, `names=`, and array modparams like `num_chan=`, so multi-channel components resolve correctly — and it matches halcompile's prefix rules (e.g. `loadrt hal_parport` → `parport.0.*`)

**For INI files:**
- Unknown keys, duplicate/conflicting keys, values that don't match the expected type or enum
- Hover any key for docs; homing keys link straight to the LinuxCNC manual
- Cross-file aware: HAL files that reference `[SECTION]KEY` get checked against the actual INI

**For G-code (.ngc/.nc/.tap):**
- Hover docs for ~229 G/M-words, autocomplete for codes and parameters, O-word subroutine support

Plus the usual editor niceties everywhere: autocomplete, go-to-definition, find-all-references, rename-across-files, document outline, and quick-fixes (e.g. "add the missing INI key").

**A couple of things I think you will appreciate:**
- It's **pure static analysis** — no running LinuxCNC instance, no special setup. Just open your config folder.
- I validated it against **all 247 stock LinuxCNC configs**. That audit even turned up a handful of real conflicting-key bugs in the shipped configs.
- It's a standard **LSP**, so while the easy path is the VS Code extension, it'll plug into Neovim/Emacs/etc. too.
- **GPL-2.0**, source on GitHub: github.com/PeterStolz/linuxcnc-lsp — issues and PRs very welcome.

It's early (v0.1.x), so if it flags something it shouldn't, or misses something it should, please tell me — bug reports against your real configs are exactly what makes it better.

Please Log in or Create an account to join the conversation.

Time to create page: 0.083 seconds
Powered by Kunena Forum