public class LSPErrorReporterForXSD extends AbstractLSPErrorReporter
ErrorHandler
gives just information of the offset where there
is an error. To improve highlight XML error, this class extends the Xerces
XML reporter to catch location, key, arguments which is helpful to adjust the
LSP range.NO_RANGE
Constructor and Description |
---|
LSPErrorReporterForXSD(DOMDocument xmlDocument,
List<org.eclipse.lsp4j.Diagnostic> diagnostics) |
Modifier and Type | Method and Description |
---|---|
protected org.eclipse.lsp4j.Range |
toLSPRange(org.apache.xerces.xni.XMLLocator location,
String key,
Object[] arguments,
String message,
org.eclipse.lsp4j.DiagnosticSeverity diagnosticSeverity,
boolean fatalError,
DOMDocument document)
Create the LSP range from the SAX error.
|
addDiagnostic, createDefaultRange, getDOMDocument, initializeReporter, initializeReporter, isIgnoreFatalError, reportError
getErrorHandler, getFeature, getFeatureDefault, getLocale, getMessageFormatter, getPropertyDefault, getRecognizedFeatures, getRecognizedProperties, getSAXErrorHandler, putMessageFormatter, removeMessageFormatter, reportError, reportError, reportError, reset, setDocumentLocator, setFeature, setLocale, setProperty
public LSPErrorReporterForXSD(DOMDocument xmlDocument, List<org.eclipse.lsp4j.Diagnostic> diagnostics)
protected org.eclipse.lsp4j.Range toLSPRange(org.apache.xerces.xni.XMLLocator location, String key, Object[] arguments, String message, org.eclipse.lsp4j.DiagnosticSeverity diagnosticSeverity, boolean fatalError, DOMDocument document)
toLSPRange
in class AbstractLSPErrorReporter
location
- key
- arguments
- document
- message
- the Xerces error message.diagnosticSeverity
- the the Xerces severity.fatalError
- true if Xerces report the error as fatal and false
otherwise.Copyright © 2020. All rights reserved.