Skip to content

Commit

Permalink
Renaming method
Browse files Browse the repository at this point in the history
  • Loading branch information
hegyibalint committed Aug 21, 2024
1 parent a1151b1 commit 8e8c399
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ import org.eclipse.lsp4j.DidSaveTextDocumentParams
import org.eclipse.lsp4j.Hover
import org.eclipse.lsp4j.HoverParams
import org.eclipse.lsp4j.MarkupContent
import org.eclipse.lsp4j.Position
import org.eclipse.lsp4j.PublishDiagnosticsParams
import org.eclipse.lsp4j.Range
import org.eclipse.lsp4j.services.LanguageClient
import org.eclipse.lsp4j.services.LanguageClientAware
import org.eclipse.lsp4j.services.TextDocumentService
Expand Down Expand Up @@ -130,15 +128,18 @@ class DeclarativeTextDocumentService : TextDocumentService, LanguageClientAware
}


// Common processing -----------------------------------------------------------------------------------------------
// Documentation processing ----------------------------------------------------------------------------------------

private fun processDocument(uri: URI) = withDom(uri) { dom ->
processErrors(uri, dom)
reportSyntaxErrors(uri, dom)
}

private fun processErrors(uri: URI, dom: DocumentOverlayResult) {
/**
* Publishes the syntax errors (or the lack thereof) for the given document as LSP diagnostics.
*/
private fun reportSyntaxErrors(uri: URI, dom: DocumentOverlayResult) {
val diagnostics = dom.document.visit(ErrorToDiagnosticVisitor()).diagnostics
LOGGER.trace("Publishing diagnostics for document: {}", uri)
LOGGER.trace("Found syntax errors in document {}: {}", uri, diagnostics)
client.publishDiagnostics(
PublishDiagnosticsParams(
uri.toString(),
Expand Down

0 comments on commit 8e8c399

Please sign in to comment.