use of org.rstudio.studio.client.workbench.views.output.lint.model.AceAnnotation in project rstudio by rstudio.
the class DiagnosticsBackgroundPopup method displayMarkerDiagnostics.
private void displayMarkerDiagnostics(Marker marker) {
JsArray<AceAnnotation> annotations = editor_.getAnnotations();
for (int i = 0; i < annotations.length(); i++) {
AceAnnotation annotation = annotations.get(i);
int row = annotation.row();
if (marker.getRange().getStart().getRow() <= row && marker.getRange().getEnd().getRow() >= row) {
activeMarker_ = marker;
showPopup(annotation.text(), marker.getRange());
return;
}
}
}
use of org.rstudio.studio.client.workbench.views.output.lint.model.AceAnnotation in project rstudio by rstudio.
the class AceEditorWidget method getAnnotations.
public JsArray<AceAnnotation> getAnnotations() {
JsArray<AceAnnotation> annotations = JsArray.createArray().cast();
annotations.setLength(annotations_.size());
for (int i = 0; i < annotations_.size(); i++) annotations.set(i, annotations_.get(i).asAceAnnotation());
return annotations;
}
use of org.rstudio.studio.client.workbench.views.output.lint.model.AceAnnotation in project rstudio by rstudio.
the class AceEditorWidget method showLint.
public void showLint(JsArray<LintItem> lint) {
clearAnnotations();
JsArray<AceAnnotation> annotations = LintItem.asAceAnnotations(lint);
editor_.getSession().setAnnotations(annotations);
// Now, set (and cache) inline markers.
for (int i = 0; i < lint.length(); i++) {
LintItem item = lint.get(i);
AnchoredRange range = createAnchoredRange(Position.create(item.getStartRow(), item.getStartColumn()), Position.create(item.getEndRow(), item.getEndColumn()));
String clazz = "unknown";
if (item.getType() == "error")
clazz = lintStyles_.error();
else if (item.getType() == "warning")
clazz = lintStyles_.warning();
else if (item.getType() == "info")
clazz = lintStyles_.info();
else if (item.getType() == "style")
clazz = lintStyles_.style();
int id = editor_.getSession().addMarker(range, clazz, "text", true);
annotations_.add(new AnchoredAceAnnotation(annotations.get(i), range, id));
}
}
Aggregations