Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,11 @@ Register the Pico language and the contributions that supply the IDE with featur
((registerLanguage)) is called twice here:
1. first for fast and cheap contributions
2. asynchronously for the full monty that loads slower

The `errorRecovery` parameter can be set to `true` to enable error recovery in the parser.
When enabled, all the contributions in this file will mostly work when parse errors are
present in the input because the contributions are written to be robust
in the presence of error trees. See ((util::LanguageServer::LanguageServer)) for more details.
}
@benefits{
* You can run each contribution on an example in the terminal to test it first.
Expand Down
5 changes: 5 additions & 0 deletions rascal-lsp/src/main/rascal/library/util/LanguageServer.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ interpreter lock will make the editor services less responsive.
syntax highlighting can update their grammars and explicitly opt-out of the
special case by passing `usesSpecialCaseHighlighting = false` when
registering the ((parsing)) service.
* You can enable error recovery in the parser like by setting `allowRecovery` to `true`: `parser(#start[Program], allowRecovery=true)`.
With error recovery enabled "hard" parse errors can still occur but that will be rare. In most cases parsing with error recovery enabled
will produce a parse tree with error nodes. Syntax highlighting will still work on such trees. Note that any contributions that you add must be
able to handle such error trees or unexpected things will happen like strange results and crashes. More information on error recovery and error trees
can be found in ((ParseTree::Production)), ((ParseTree::parser)), and ((util::ParseErrorRecovery)).
* The ((analysis)) service indexes a file as a ((Summary)), offering precomputed relations for looking up
hover documentation, definition with uses, references to declarations, implementations of types and compiler errors and warnings.
* ((analysis)) focuses on their own file, but may reuse cached or stored indices from other files.
Expand Down
Loading