|
From: Markus B. <mba...@us...> - 2005-09-07 21:24:31
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23392/src/org/rubypeople/rdt/ui Modified Files: RubyElementLabelProvider.java Log Message: show jruby syntaxexeptions in outline view Index: RubyElementLabelProvider.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyElementLabelProvider.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RubyElementLabelProvider.java 12 Jul 2005 00:05:03 -0000 1.5 --- RubyElementLabelProvider.java 7 Sep 2005 21:24:23 -0000 1.6 *************** *** 4,7 **** --- 4,8 ---- import org.eclipse.jface.viewers.ILabelProviderListener; import org.eclipse.swt.graphics.Image; + import org.jruby.lexer.yacc.SyntaxException; import org.rubypeople.rdt.core.IRubyElement; import org.rubypeople.rdt.core.IMethod; *************** *** 78,81 **** --- 79,91 ---- public String getText(Object obj) { if (obj instanceof IRubyElement) return ((IRubyElement) obj).getElementName(); + if (obj instanceof SyntaxException) { + SyntaxException syntaxException = (SyntaxException) obj ; + StringBuffer sb = new StringBuffer() ; + sb.append("Line ") ; + sb.append(syntaxException.getPosition().getStartLine()) ; + sb.append(": ") ; + sb.append(syntaxException.getMessage()) ; + return sb.toString() ; + } return "Invalid object: " + obj.getClass().getName(); } |