source: default/v2/trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/quickfix/EbnfQuickfixProvider.xtend @ 61

Last change on this file since 61 was 61, checked in by hkaulbersch, 10 years ago

initial commit

File size: 1.3 KB
Line 
1/*
2* generated by Xtext
3*/
4package de.ugoe.cs.swe.bnftools.ui.quickfix
5
6import org.eclipse.xtext.ui.editor.quickfix.Fix
7import org.eclipse.xtext.ui.editor.quickfix.IssueResolutionAcceptor
8import org.eclipse.xtext.validation.Issue
9
10/**
11 * Custom quickfixes.
12 *
13 * see http://www.eclipse.org/Xtext/documentation.html#quickfixes
14 */
15class 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}
Note: See TracBrowser for help on using the repository browser.