Syntactic completion does not work in nightly
Syntactic completion templates depend on special grammar production rules that are automatically generated by make-permissive.jar. This works in Spoofax-stable, however, it seems that Spoofax-nightly uses an old version of the make-permissive tool.
Submitted by Maartje on 2 September 2013 at 19:11
Issue Log
We observed this as well in Green-Marl, syntactic completions don’t work. In NaBL, syntactic completions (generated by SDF3) do actually work. The only big difference between those projects is that Green-Marl uses the Stratego Java backend, where NaBL uses the interpreter. But it would be weird if this caused it?
I did remove spoofaxlang from our main build a couple of weeks ago. Spoofax actually used the make-permissive in the spoofaxlang generator, which may have been newer than the one in the standard generator. If so, a fix would be to copy the jar from the spoofaxlang generator into the standard generator.
I am not sure how this relates to the problems in Green-Marl, but I have a student working on an individual schedule for the IN4303 assignments. He mentioned that his manually completion templates do not work until he adds a completion proposer and a completion strategy (even if it is not implemented) to the esv file.
Just copying a JAR sounds like a bad idea. We need to understand the version dependencies and the source code that generates them.
The make-permissive.jar is build by the make-permissive project “https://github.com/metaborg/jsglr/blob/master/make-permissive/make-permissive.astr”.
The jar is responsible for extending the grammar (include/MyLang.def => include/MyLang-Permissive.def) with 1) water recovery rules 2) insertion recovery rules 3) syntactic completion rules. The syntactic completion rules help the parser to decide whether a syntactic construct is expected at the cursor location. The problem seems to be that the syntactic completion rules are generated in Spoofax-stable, but not in Spoofax-nightly.Example of such a rule:
“|#Definition|” -> Definition {completion}This rule supports the template:
completion template Definition :
“entity " " {” (cursor) “}” (blank)
Ah, so this is a separate issue from completion templates generated from SDF3 (template language) not working? Since the ones from SDF3 go into an ESV file.
Right now, make-permissive is a static jar (committed to the repo: https://github.com/metaborg/spoofax/blob/master/org.strategoxt.imp.generator/lib/make_permissive.jar) in the Spoofax generator project, but it should probably be built in the build farm?
Log in to post comments