Skip to content

Commit

Permalink
Added documentation about the parser function, with a link to the lsp…
Browse files Browse the repository at this point in the history
… token types
  • Loading branch information
DavyLandman committed Mar 20, 2024
1 parent 1dc506a commit 672e19a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rascal-lsp/src/main/rascal/util/LanguageServer.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ Language language(PathConfig pcfg, str name, str extension, str mainModule, str
= language(pcfg, name, {extension}, mainModule, mainFunction);

@synopsis{Function profile for parser contributions to a language server}
@description{
The parser function takes care of parsing the tree once after every change in the IDE.
This parse tree is then used for both syntax highlighting and other language server functions.
}
@pitfalls {
* use ((function::IO::parser)) instead of writing your own function to ensure syntax highlighting is fast
* when customizing token type categories, do not use textmate scopes, but use [LSP's token types](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#semanticTokenTypes)
}
alias Parser = Tree (str /*input*/, loc /*origin*/);

@synopsis{Function profile for summarizer contributions to a language server}
Expand Down

0 comments on commit 672e19a

Please sign in to comment.