NetStacksNetStacks

Language Support (LSP)

Python diagnostics and completion via the bundled Pyrefly language server, plus YANG, XML, and JSON support — and a pluggable LSP system so you can add your own language servers.

Overview

Beyond syntax highlighting, the Workspace runs language servers so the editor can offer diagnostics, completion, hover, go-to definition, and formatting for the languages network engineers use most. Language servers are hosted by the local Agent.

Python (Pyrefly)

Python support is provided by Pyrefly, a fast static-analysis language server. It is downloaded on demand the first time you open a Python file, so it does not bloat the installer, and it works both on a project and on loose standalone files.

Note

The first Python file you open triggers a one-time Pyrefly download. After that, diagnostics and completion are available with no further setup.

YANG, XML & JSON

YANG models get dedicated syntax highlighting and an indentation-aware formatter. XML and JSON get highlighting plus formatting. These run client-side and need no download.

Adding Language Servers

The LSP layer is pluggable. Pyrefly ships as a built-in plugin, and you can register additional language servers (for example a Go or alternative Python server) through a descriptor — without waiting for a NetStacks release. Manage installed servers from settings: install, enable, or disable them per language.

lsp-plugin-model.txtbash
# A language-server plugin is described by:
#  - the language id(s) it serves
#  - how to obtain the server binary
#  - the command used to launch it
# Built-in: Pyrefly (Python). User-added servers
# follow the same descriptor shape.

Q&A

Q: Why is the first Python file slow to get diagnostics?
A: Pyrefly is fetched on first use. Subsequent files are immediate.
Q: Can I use my own language server?
A: Yes — register it as an LSP plugin via its descriptor and enable it from settings.
Q: Does language analysis send my code anywhere?
A: No. Language servers run locally under the Agent; nothing is uploaded.