1 | /* |
---|
2 | * generated by Xtext |
---|
3 | */ |
---|
4 | package de.ugoe.cs.swe.bnftools.ui.quickfix |
---|
5 | |
---|
6 | import org.eclipse.xtext.ui.editor.quickfix.Fix |
---|
7 | import org.eclipse.xtext.ui.editor.quickfix.IssueResolutionAcceptor |
---|
8 | import org.eclipse.xtext.validation.Issue |
---|
9 | |
---|
10 | /** |
---|
11 | * Custom quickfixes. |
---|
12 | * |
---|
13 | * see http://www.eclipse.org/Xtext/documentation.html#quickfixes |
---|
14 | */ |
---|
15 | class EbnfQuickfixProvider extends org.eclipse.xtext.ui.editor.quickfix.DefaultQuickfixProvider { |
---|
16 | |
---|
17 | |
---|
18 | static final String ruleReferencedOneDescription = "The rule is only referenced by one other rule"; |
---|
19 | |
---|
20 | // @Fix(MyDslValidator::INVALID_NAME) |
---|
21 | // def capitalizeName(Issue issue, IssueResolutionAcceptor acceptor) { |
---|
22 | // acceptor.accept(issue, 'Capitalize name', 'Capitalize the name.', 'upcase.png') [ |
---|
23 | // context | |
---|
24 | // val xtextDocument = context.xtextDocument |
---|
25 | // val firstLetter = xtextDocument.get(issue.offset, 1) |
---|
26 | // xtextDocument.replace(issue.offset, 1, firstLetter.toUpperCase) |
---|
27 | // ] |
---|
28 | // } |
---|
29 | |
---|
30 | |
---|
31 | // @Fix(value = ruleReferencedOneDescription) |
---|
32 | // def void fixInlineRuleReferencedOnce(final Issue issue, IssueResolutionAcceptor acceptor) { |
---|
33 | // InlineRuleModification inlineRuleModification = new InlineRuleModification( |
---|
34 | // resourceDescriptions); |
---|
35 | // |
---|
36 | // acceptor.accept( |
---|
37 | // issue, |
---|
38 | // "Inline the rule", |
---|
39 | // "Delete the rule and replace its single reference by the rule's right side", |
---|
40 | // "upcase.png", inlineRuleModification); |
---|
41 | // } |
---|
42 | } |
---|