Add documentation about using recovery rules for content completion etc.
Add some documentation about using recover rules to improve content completions (e.g.,
ID "@" ID -> ComplexConstruct {recover}
forID "@" ComplexConstruct -> ComplexConstruct
). To know whether a recover rule is a good idea you probably have to look at the generated AST.As an alternative, maybe the best strategy for these cases is to not use recovery rules at all, but just normal rules that trigger a semantic error?
See also Spoofax/150: Recover rules do not result in an error.
Submitted by Lennart Kats on 10 June 2010 at 14:53
Issue Log
Spoofax currently prints a debugging message like
:: Completion triggered for: SemanticProvider(COMPLETION("include/foo.jar")) (candidate sorts: [SemanticRule])
to the console. Perhaps it can print some more information in case of a parsing error (
NOCONTEXT
). The message could refer to the online documentation.
A nice example case where this happens:
entity URL {
location : String
}Adding a rule like
ID -> Property {cons(“PartialProperty”), recover}would enable semantic content completion for partial properties. (Note that Spoofax/247 breaks this example.)
See https://mailman.st.ewi.tudelft.nl/pipermail/users/2010-December/000311.html. For now, I added a refrence from the FAQ to this posting.
Log in to post comments