Part V — The Modern Experience Layer · Chapter 30 · Lesson 1 of 2
The language server and editor tooling
The difference between a toy language and a tool you keep installed is the editor loop. PeaLang 1.x ships a real one.
The LSP server
v1.1.0 added LSPServer and build_lsp_namespace — a standards-compliant language server implementing diagnostics, hover, completion and document symbols. Point any LSP-capable editor (VS Code, Neovim, Helix, Zed) at it and you get:
- Diagnostics on save (or on change, depending on settings): the same errors
pea checkreports, inline. - Hover: type information and doc comments for the symbol under the cursor.
- Completion: keywords, builtins and symbols in scope.
- Symbols: outline of the file — functions, tests, modules.
pea doctor
pea doctor
# checks: python version, pealang install, spec integrity,
# features enabled, stdlib presence, writable cache,
# capability policy vs host
ux.doctor() is the same check from inside a program — embed it in a startup script or a CI smoke test. It reports a checklist with pass/fail and remediation hints, not a stack trace.
ux.explain and ux.suggest
import ux
let hint = ux.explain("PEA0123") # what the diagnostic means + fix
let fix = ux.suggest(source, "PEA0123") # suggested rewrite
Diagnostics carry stable codes (PEAonumber); ux.explain turns the code into a paragraph a human can act on; ux.suggest goes one step further and produces the patch. Wire ux.suggest into your editor quick-fix if you want one-keystroke fixes.
Notebook display (v1.8.0)
For exploratory work, the display helpers (display_records, display_profile, display_model, display_chart, display_report) render values and analysis artifacts in notebooks — check editors/ in the repo for the current integrations. Publishing a notebook as a webapp is a first-class operation: publish_as_webapp.
Guided practice
- Run
pea doctor; fix anything it flags; paste its output into a teammate's chat if onboarding is mysteriously broken for them. - Deliberately write a type error; confirm the LSP surfaces it inline without running
pea check. - Call
ux.explainon the first diagnostic you see and read the paragraph — you will stop asking what PEA codes mean.