Support for Ott specifications (.ott)
in VS Code, through haskott's
language server:
- every problem of a specification, as you type;
- go to definition, find references and highlight for metavariables, index variables and grammar rules, across the files of a specification;
- an outline of each file;
- rename, checked before it is applied;
- highlighting that knows what the specification's grammar makes of each identifier: terminals, nonterminals, metavariables and index variables, in productions, rule lines and quotations.
A TextMate grammar highlights the metalanguage (keywords, comments, homs, productions, rule names) until the language server's semantic tokens arrive, and wherever they don't reach.
The extension starts haskott lsp, so haskott must be installed. From a
checkout of haskott:
$ cabal install exe:haskottIf haskott is not on your PATH, set ott.server.path to the
executable.
A specification made of several files is listed in a haskott.json at or
above them, in the order Ott reads them; see haskott's README. A file that
no haskott.json lists is checked on its own.
ott.server.path: the haskott executable (defaulthaskott).ott.server.args: the arguments that start the server (default["lsp"]).ott.trace.server: log the messages between VS Code and the server (off,messagesorverbose).
The Ott: Restart Language Server command restarts the server, as does
changing ott.server.*.
$ npm install
$ npm test # type check and grammar tests
$ npm run build # out/extension.js
$ npm run package # ott-<version>.vsixTo try it, open this directory in VS Code and run the Run Extension
launch configuration, or install the .vsix with Extensions: Install
from VSIX….
test/grammar holds the grammar tests, in the format of
vscode-tmgrammar-test.