void LanguageServerCluster::OnClearDiagnostics(LSPEvent& event) { event.Skip(); wxString uri = event.GetLocation().GetUri(); wxFileName fn(uri); IEditor* editor = clGetManager()->FindEditor(fn.GetFullPath()); if(editor) { editor->DelAllCompilerMarkers(); } }
void LanguageServerCluster::OnSetDiagnostics(LSPEvent& event) { event.Skip(); wxString uri = event.GetLocation().GetUri(); wxFileName fn(uri); IEditor* editor = clGetManager()->FindEditor(fn.GetFullPath()); if(editor) { editor->DelAllCompilerMarkers(); for(const LSP::Diagnostic& d : event.GetDiagnostics()) { // LSP uses 1 based line numbers editor->SetErrorMarker(d.GetRange().GetStart().GetLine(), d.GetMessage()); } } }