This is a bug with the quikfix? [message #894501] |
Mon, 09 July 2012 12:57 |
Vil Lpz Messages: 24 Registered: April 2012 |
Junior Member |
|
|
Hi!
I'm trying the quickfix feature of xtext and I found the following problem.
If I use ISemanticModification this way ...
acceptor.accept(issue, "Change to "+ parentStateName + "." + viewName, "Replace the state ID for a valid View name.", "upcase.png", new ISemanticModification() {
public void apply(EObject element, IModificationContext context) throws Exception {
// sabemos que es un state de tipo view
ScxmlStateType state = (ScxmlStateType) element;
state.setName("\""+parentStateName + "." + viewName+"\"");
}
});
And use the quickfix in the second state (to fix the ERRONEUS_ID) in this text:
<state id="SecondOp" mymw:category="UseCase" initial="SecondOp.suma">
<!-- Presentación suma -->
<state id="ERRONEUS_ID" mymw:category="View">
<!-- llamando a un método de una clase concreta al enviar un formulario -->
<transition event="mySubmit.onsubmit" target="SecondOp.resultado">
.
.
.
The pre-and post comments to the line where I do the quickfix disappear! The result...
<state id="SecondOp" mymw:category="UseCase" initial="SecondOp.suma">
<state id="CORRECT_ID" mymw:category="View">
<transition event="mySubmit.onsubmit" target="SecondOp.resultado">
.
.
.
If I use IModification() this does not happen (the comments not disappear)...
acceptor.accept(issue, "Change to "+ parentStateName + "." + viewName, "Replace the state ID for a valid View name.", "upcase.png", new IModification() {
public void apply(IModificationContext context) throws BadLocationException {
IXtextDocument xtextDocument = context.getXtextDocument();
xtextDocument.replace(issue.getOffset(), issue.getLength(), "\""+parentStateName + "." + viewName+"\"");
}
Any idea that could be happening?
Thanks!!
[Updated on: Tue, 10 July 2012 06:59] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04265 seconds