COCOR-LSP.md 1.1 KB

Coco/R diagnostics through LSP

Version 0.1.7 adds the first real Language Server connection. The Theia/VS Code extension starts out/server.js through vscode-languageclient; the server invokes a configured executable containing the generated Coco/R parser/validator.

Oberon dialects (.Mod / .mod / .def, Ulmo .om / .od)

The server validates Oberon files with the pilot validators from grammars/. Each pilot binary takes the source file as its single argument and writes a .LST listing next to it; the server parses the listing's ***** ^ message lines (positions are caret-relative to the code after the listing prefix, zero-based columns).

"modula2.oberon.dialect": "oberon2",
"modula2.oberon.validators": {
  "oberon07": "<root>/grammars/Oberon07/build/O07",
  "oberon2": "<root>/grammars/Oberon2/build/O2",
  "ulm": "<root>/grammars/Ulm/build/Ulm"
}

Build each binary first with its pilot build.sh (needs CR and gm2 -fiso). The local Modula-2 analysis never runs on Oberon text. With no command configured for the active dialect the server publishes no diagnostics.