use of org.rstudio.studio.client.workbench.views.source.editors.text.cpp.CppCompletionOperation in project rstudio by rstudio.
the class LintManager method performCppLintServerRequest.
private void performCppLintServerRequest(final LintContext context) {
cppCompletionContext_.cppCompletionOperation(new CppCompletionOperation() {
@Override
public void execute(String docPath, int line, int column) {
server_.getCppDiagnostics(target_.getPath(), new ServerRequestCallback<JsArray<CppDiagnostic>>() {
@Override
public void onResponseReceived(JsArray<CppDiagnostic> diag) {
if (context.token.isInvalid())
return;
final JsArray<LintItem> cppLint = CppCompletionRequest.asLintArray(diag);
server_.lintRSourceDocument(target_.getId(), target_.getPath(), context.showMarkers, context.explicit, new ServerRequestCallback<JsArray<LintItem>>() {
@Override
public void onResponseReceived(JsArray<LintItem> rLint) {
if (context.token.isInvalid())
return;
JsArray<LintItem> allLint = JsArray.createArray().cast();
for (int i = 0; i < cppLint.length(); i++) allLint.push(cppLint.get(i));
for (int i = 0; i < rLint.length(); i++) allLint.push(rLint.get(i));
showLint(context, allLint);
}
@Override
public void onError(ServerError error) {
Debug.logError(error);
}
});
}
@Override
public void onError(ServerError error) {
Debug.logError(error);
}
});
}
});
}
Aggregations