|Quick fix with linked-mode editing? [message #978155]
||Fri, 09 November 2012 22:03
| Stephan Herrmann
Registered: July 2009
In my latest experiments I tried to implement a quick fix with the following ambitious characteristics:|
* react to a linking error (i.e., create a missing model element)
- potentially use more information from the context of the error
* insert a skeleton of the new element
* some details of the new element will need editing
- either select from existing model elements for cross references
- or choose some new names
* some details of the new element will be in the positions of cross references, but it should be allowed to enter fresh names (yet unresolved, to be fixed by the next quick fix invocation).
Some of these are readily implementable using Xtext's infrastrature for semantic modifications. Other characteristics better match what can be done with template proposals (completion).
However, I've hit some limitations when trying to put it all together:
- semantic modifications cannot insert references to not-yet-existing elements
- I couldn't see how to get linked mode working from a quick fix
- when trying to programmatically trigger a template proposal from a quick fix provider I fail to see how I could get access to some required references like the current ITextViewer etc.
Instead of combining quick fix and template also a concept of placeholder model elements could be useful which could then be handled by the framework (using linked mode for user input).
Has anyone tried s.t. along these lines?
Powered by FUDForum
. Page generated in 0.01785 seconds