private boolean appliesToContext(CodeActionContext context) { if (context!=null) { return context.getDiagnostics().stream().anyMatch(diag -> this.diagMsg == null || this.diagMsg.equals(diag.getMessage()) ); } return true; } }
public Quickfix(String CODE_ACTION_CMD_ID, Diagnostic diag, QuickfixData<T> data) { super(); this.CODE_ACTION_CMD_ID = CODE_ACTION_CMD_ID; this.range = diag.getRange(); this.diagMsg = diag.getMessage(); this.data = data; }
private String problemSumary(Editor editor, List<Diagnostic> actualProblems) throws Exception { StringBuilder buf = new StringBuilder(); for (Diagnostic p : actualProblems) { buf.append("\n----------------------\n"); String snippet = editor.getText(p.getRange()); buf.append("("+p.getRange().getStart().getLine()+", "+p.getRange().getStart().getCharacter()+")["+snippet+"]:\n"); buf.append(" "+p.getMessage()); } return buf.toString(); }
@Override public int compare(Diagnostic o1, Diagnostic o2) { int diff = compare(o1.getRange().getStart(), o2.getRange().getStart()); if (diff!=0) return diff; diff = compare(o1.getRange().getEnd(), o2.getRange().getEnd()); if (diff!=0) return diff; return o1.getMessage().compareTo(o2.getMessage()); }
String diagnosticMessage = diagnostic.getMessage(); List<Command> commands = new ArrayList<>(); Position position = params.getRange().getStart();
&& snippetBefore.equals(doc.textBetween(start - snippetBefore.length(), start)) && snippetAfter.equals(doc.textBetween(end, end+snippetAfter.length())) && problem.getMessage().contains(messageSnippet);
setSource((java.lang.String)sourceVal); if (o.getMessage() == null) { setMessage((java.lang.String)null); } else { java.lang.String messageVal = (java.lang.String)makeDto(o.getMessage());; setMessage((java.lang.String)messageVal);
Diagnostic clone(Diagnostic diagnostic) { if (diagnostic == null) { return null; } String code = diagnostic.getCode(); String message = diagnostic.getMessage(); Range range = diagnostic.getRange(); List<DiagnosticRelatedInformation> relatedInformation = diagnostic.getRelatedInformation(); DiagnosticSeverity severity = diagnostic.getSeverity(); String source = diagnostic.getSource(); Diagnostic cloned = new Diagnostic(); cloned.setCode(code); cloned.setMessage(message); cloned.setRange(clone(range)); cloned.setRelatedInformation(cloneDRI(relatedInformation)); cloned.setSeverity(severity); cloned.setSource(source); return cloned; }