quick fix added twice on save [message #532547] |
Mon, 10 May 2010 12:44 |
Henrik Lindberg Messages: 2509 Registered: July 2009 |
Senior Member |
|
|
Hi,
When saving a b3 file with an error for which there is a quick fix, I
get two quick fix proposals in the quickfix popup menu after saving the
file.
I am not using Xtext nature, and therefore use
public Class<? extends IXtextEditorCallback> bindIXtextEditorCallback()
{ return ValidatingEditorCallback.class; }
The validation is done like this:
----
@Check
public void checkRepository(Repository repoHandler) {
if(repoHandler.getRemote() == null) {
error("The repository must have an URI declared as 'remote = <URI>'",
repoHandler,
B3BuildPackage.REPOSITORY__HANDLER_TYPE,
ISSUE_REPOSITORY__NO_REMOTE);
}
And the fix like this:
---
private final static String ISSUE_REPOSITORY__NO_REMOTE_FIX =
"http://abc.org";
@Fix(BeeLangJavaValidator.ISSUE_REPOSITORY__NO_REMOTE)
public void insertRemoteURI(final Issue issue, IssueResolutionAcceptor
acceptor) {
acceptor.accept(
issue, "Insert remote URI", "remote = \"" +
ISSUE_REPOSITORY__NO_REMOTE_FIX + "\"", "",
new ISemanticModification() {
public void apply(EObject element, IModificationContext
context) throws Exception {
Repository repo = (Repository) element;
repo.setRemote(URI.create(ISSUE_REPOSITORY__NO_REMOTE_FIX));
}
});
}
Questions
---
Is the validation and fix done as they should?
Is there something else I need to do?
Regards
- henrik
|
|
|
Re: quick fix added twice on save [message #532651 is a reply to message #532547] |
Mon, 10 May 2010 16:38 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Henrik,
that's a regression.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=312297
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 10.05.10 14:44, schrieb Henrik Lindberg:
> Hi,
> When saving a b3 file with an error for which there is a quick fix, I
> get two quick fix proposals in the quickfix popup menu after saving the
> file.
>
> I am not using Xtext nature, and therefore use
> public Class<? extends IXtextEditorCallback> bindIXtextEditorCallback()
> { return ValidatingEditorCallback.class; }
>
> The validation is done like this:
> ----
> @Check
> public void checkRepository(Repository repoHandler) {
> if(repoHandler.getRemote() == null) {
> error("The repository must have an URI declared as 'remote = <URI>'",
> repoHandler,
> B3BuildPackage.REPOSITORY__HANDLER_TYPE,
> ISSUE_REPOSITORY__NO_REMOTE);
> }
>
> And the fix like this:
> ---
> private final static String ISSUE_REPOSITORY__NO_REMOTE_FIX =
> "http://abc.org";
>
> @Fix(BeeLangJavaValidator.ISSUE_REPOSITORY__NO_REMOTE)
> public void insertRemoteURI(final Issue issue, IssueResolutionAcceptor
> acceptor) {
> acceptor.accept(
> issue, "Insert remote URI", "remote = \"" +
> ISSUE_REPOSITORY__NO_REMOTE_FIX + "\"", "",
> new ISemanticModification() {
> public void apply(EObject element, IModificationContext context) throws
> Exception {
> Repository repo = (Repository) element;
> repo.setRemote(URI.create(ISSUE_REPOSITORY__NO_REMOTE_FIX));
> }
> });
> }
>
> Questions
> ---
> Is the validation and fix done as they should?
> Is there something else I need to do?
>
> Regards
> - henrik
|
|
|
Powered by
FUDForum. Page generated in 0.03260 seconds