-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
documentation about migrating old projects to use the new completion …
…framework
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# New Completions Framework | ||
|
||
In the latest Spoofax, we provide (beta) support for content completion on syntactic correct programs. | ||
|
||
On such programs, the completion service can be invoked to add elements to lists or to add missing terms. Furthermore, programs can contain explicit placeholders and be in an incomplete state. The completion service can be triggered on these placeholders to further extend the program. | ||
|
||
An example is shown below: | ||
|
||
![Completion for Statement](completion_statement.png) | ||
|
||
In this case, the explicit placeholder `[[Statement]]` can be extended by any of the shown completion suggestions. | ||
|
||
New projects come automatically with support for the new completions framework. | ||
To migrate old projects it is necessary to: | ||
|
||
- add the following imports to the main Stratego file: | ||
- `completion/-`. This imports all the stratego files, generated from the SDF3 grammar. | ||
- `runtime/completion/-`. This imports the completion framework, part of the runtime-libraries. | ||
- add the following strategy to the trans/pp.str file: | ||
- `pp-completion = pp-partial-<LanguageName>-string` | ||
- add the following import to `<LanguageName>-Colorer.esv`: | ||
- `completion/colorer/<LanguageName>-cc-esv`. This import the editor files responsible for coloring the explicit placeholders. | ||
|
||
Currently, completion should only work properly for correct/incomplete programs. Completion for incorrect programs should happen soon, and also more IDE support. In case of any issue or suggestion for improvement, please report in http://yellowgrass.org/project/SpoofaxWithCore. |