Add some documentation about using recover rules to improve content completions (e.g., ID "@" ID -> ComplexConstruct {recover} for ID "@" 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

On 6 September 2010 at 13:57 Lennart Kats commented:

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.


On 6 September 2010 at 16:01 Lennart Kats commented:

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.)


On 8 December 2010 at 14:04 Lennart Kats commented:

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.


On 8 December 2010 at 15:55 Lennart Kats closed this issue.

On 23 March 2011 at 14:57 Tobi Vollebregt tagged completion

On 29 November 2011 at 16:43 Lennart Kats tagged 1.0

On 28 December 2011 at 13:17 Lennart Kats tagged @lennartkats

Log in to post comments