protected void selectInEditor(Token token) {
   int line = token.getLine();
   line--; // -1 because SableCC lines are 1-based
   WorkingCopy workingCopy = editor.getWorkingCopy();
   IDocument document = workingCopy.getDocument();
   try {
     int start = document.getLineOffset(line);
     editor.selectAndReveal(start, 0);
   } catch (BadLocationException e) {
     UIUtils.log(e);
   }
 }
Exemplo n.º 2
0
 public static void addProblem(IProblemTracker problems, IProblem problem, Node node) {
   final Token token = findToken(node);
   if (token != null) problem.setAttribute(IProblem.LINE_NUMBER, token.getLine());
   problems.add(problem);
 }