List of usage examples for org.eclipse.jdt.internal.compiler.problem DefaultProblem getSourceColumnNumber
public int getSourceColumnNumber()
From source file:org.jboss.tools.vscode.java.internal.handlers.DiagnosticsHandler.java
License:Open Source License
private Range convertRange(IProblem problem) { Range range = new Range(); Position start = new Position(); Position end = new Position(); start.setLine(Double.valueOf(problem.getSourceLineNumber() - 1));// VSCode is 0-based end.setLine(Double.valueOf(problem.getSourceLineNumber() - 1)); if (problem instanceof DefaultProblem) { DefaultProblem dProblem = (DefaultProblem) problem; start.setCharacter(Double.valueOf(dProblem.getSourceColumnNumber() - 1)); int offset = 0; if (dProblem.getSourceStart() != -1 && dProblem.getSourceEnd() != -1) { offset = dProblem.getSourceEnd() - dProblem.getSourceStart() + 1; }//from www . ja va 2 s .co m end.setCharacter(Double.valueOf(dProblem.getSourceColumnNumber() - 1 + offset)); } return range.withEnd(end).withStart(start); }