public void buildFile(BuildContext context, IProgressMonitor monitor) { String contents = null; String uri = context.getName(); try { contents = context.getContents(); RubyParseState parseState = new RubyParseState(contents, uri, 1, version); uri = context.getURI().toString(); context.getAST(parseState); } catch (CoreException e) { // ignore, just forcing a parse } Collection<IProblem> problems = new ArrayList<IProblem>(); for (IParseError parseError : context.getParseErrors()) { int severity = parseError.getSeverity().intValue(); int line = -1; if (contents != null) { line = getLineNumber(parseError.getOffset(), contents); } problems.add( new Problem( severity, parseError.getMessage(), parseError.getOffset(), parseError.getLength(), line, uri)); } context.putProblems(IMarker.PROBLEM, problems); }