The Theia/VS Code extension starts out/server.js through
vscode-languageclient. Two diagnostic sources merge on every edit:
END checks plus a lenient
declaration parser driving all navigation features below..pas / .pp / .p)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.pascal.dialect": "freepascal",
"modula2.pascal.validators": {
"p2": "<root>/grammars/P2/build/P2",
"p4": "<root>/grammars/P4/build/P4",
"p6": "<root>/grammars/P6/build/P6",
"pascal": "<root>/grammars/Pascal/build/PStd",
"turbopascal3": "<root>/grammars/TurboPascal3/build/TP3",
"freepascal": "<root>/grammars/FreePascal/build/FPC",
"blaise": "<root>/grammars/Blaise/build/BlaiseV",
"pascals": "<root>/grammars/PascalS/build/PascalS"
}
Build each binary first with its pilot build.sh (needs CR and
gm2 -fiso). With no command configured for the active dialect the
server publishes no validator diagnostics. Never point these at the
pcom/psc oracle compilers — they can hang on invalid input.
parsePascal: programs, units, routines, params, locals,
record fields, enum literals).-triggered: unit interface names, record fields,
visible declarations, keywords, predefined routines)Unit.Name
resolution through USES (same-directory .pas/.pp/.p) and
go-to-unit on USES names; matching is case-insensitivemodula2.pascal.format.*), semantic
tokens, snippets, uppercase-while-typing
(modula2.pascal.uppercaseKeywords)