Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » quick fix added twice on save
quick fix added twice on save [message #532547] Mon, 10 May 2010 12:44 Go to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
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 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
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
Previous Topic:How to adapt ImportResolver in 1.0M7
Next Topic:Drag&Drop in(to) XtextEditor
Goto Forum:
  


Current Time: Wed May 01 21:41:37 GMT 2024

Powered by FUDForum. Page generated in 0.03260 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top