Package org.eclipse.lsp4j
Class Diagnostic
- java.lang.Object
-
- org.eclipse.lsp4j.Diagnostic
-
public class Diagnostic extends java.lang.ObjectRepresents a diagnostic, such as a compiler error or warning. Diagnostic objects are only valid in the scope of a resource.
-
-
Constructor Summary
Constructors Constructor Description Diagnostic()Diagnostic(Range range, java.lang.String message)Diagnostic(Range range, java.lang.String message, DiagnosticSeverity severity, java.lang.String source)Diagnostic(Range range, java.lang.String message, DiagnosticSeverity severity, java.lang.String source, java.lang.String code)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)org.eclipse.lsp4j.jsonrpc.messages.Either<java.lang.String,java.lang.Integer>getCode()The diagnostic's code.DiagnosticCodeDescriptiongetCodeDescription()An optional property to describe the error code.java.lang.ObjectgetData()A data entry field that is preserved between a `textDocument/publishDiagnostics` notification and `textDocument/codeAction` request.java.lang.StringgetMessage()The diagnostic's message.RangegetRange()The range at which the message appliesjava.util.List<DiagnosticRelatedInformation>getRelatedInformation()An array of related diagnostic information, e.g.DiagnosticSeveritygetSeverity()The diagnostic's severity.java.lang.StringgetSource()A human-readable string describing the source of this diagnostic, e.g.java.util.List<DiagnosticTag>getTags()Additional metadata about the diagnostic.inthashCode()voidsetCode(java.lang.Integer code)voidsetCode(java.lang.String code)voidsetCode(org.eclipse.lsp4j.jsonrpc.messages.Either<java.lang.String,java.lang.Integer> code)The diagnostic's code.voidsetCodeDescription(DiagnosticCodeDescription codeDescription)An optional property to describe the error code.voidsetData(java.lang.Object data)A data entry field that is preserved between a `textDocument/publishDiagnostics` notification and `textDocument/codeAction` request.voidsetMessage(java.lang.String message)The diagnostic's message.voidsetRange(Range range)The range at which the message appliesvoidsetRelatedInformation(java.util.List<DiagnosticRelatedInformation> relatedInformation)An array of related diagnostic information, e.g.voidsetSeverity(DiagnosticSeverity severity)The diagnostic's severity.voidsetSource(java.lang.String source)A human-readable string describing the source of this diagnostic, e.g.voidsetTags(java.util.List<DiagnosticTag> tags)Additional metadata about the diagnostic.java.lang.StringtoString()
-
-
-
Constructor Detail
-
Diagnostic
public Diagnostic()
-
Diagnostic
public Diagnostic(Range range, java.lang.String message)
-
Diagnostic
public Diagnostic(Range range, java.lang.String message, DiagnosticSeverity severity, java.lang.String source)
-
Diagnostic
public Diagnostic(Range range, java.lang.String message, DiagnosticSeverity severity, java.lang.String source, java.lang.String code)
-
-
Method Detail
-
getRange
public Range getRange()
The range at which the message applies
-
setRange
public void setRange(Range range)
The range at which the message applies
-
getSeverity
public DiagnosticSeverity getSeverity()
The diagnostic's severity. Can be omitted. If omitted it is up to the client to interpret diagnostics as error, warning, info or hint.
-
setSeverity
public void setSeverity(DiagnosticSeverity severity)
The diagnostic's severity. Can be omitted. If omitted it is up to the client to interpret diagnostics as error, warning, info or hint.
-
getCode
public org.eclipse.lsp4j.jsonrpc.messages.Either<java.lang.String,java.lang.Integer> getCode()
The diagnostic's code. Can be omitted.
-
setCode
public void setCode(org.eclipse.lsp4j.jsonrpc.messages.Either<java.lang.String,java.lang.Integer> code)
The diagnostic's code. Can be omitted.
-
setCode
public void setCode(java.lang.String code)
-
setCode
public void setCode(java.lang.Integer code)
-
getCodeDescription
public DiagnosticCodeDescription getCodeDescription()
An optional property to describe the error code.Since 3.16.0
-
setCodeDescription
public void setCodeDescription(DiagnosticCodeDescription codeDescription)
An optional property to describe the error code.Since 3.16.0
-
getSource
public java.lang.String getSource()
A human-readable string describing the source of this diagnostic, e.g. 'typescript' or 'super lint'.
-
setSource
public void setSource(java.lang.String source)
A human-readable string describing the source of this diagnostic, e.g. 'typescript' or 'super lint'.
-
getMessage
public java.lang.String getMessage()
The diagnostic's message.
-
setMessage
public void setMessage(java.lang.String message)
The diagnostic's message.
-
getTags
public java.util.List<DiagnosticTag> getTags()
Additional metadata about the diagnostic.Since 3.15.0
-
setTags
public void setTags(java.util.List<DiagnosticTag> tags)
Additional metadata about the diagnostic.Since 3.15.0
-
getRelatedInformation
public java.util.List<DiagnosticRelatedInformation> getRelatedInformation()
An array of related diagnostic information, e.g. when symbol-names within a scope collide all definitions can be marked via this property.Since 3.7.0
-
setRelatedInformation
public void setRelatedInformation(java.util.List<DiagnosticRelatedInformation> relatedInformation)
An array of related diagnostic information, e.g. when symbol-names within a scope collide all definitions can be marked via this property.Since 3.7.0
-
getData
public java.lang.Object getData()
A data entry field that is preserved between a `textDocument/publishDiagnostics` notification and `textDocument/codeAction` request.Since 3.16.0
-
setData
public void setData(java.lang.Object data)
A data entry field that is preserved between a `textDocument/publishDiagnostics` notification and `textDocument/codeAction` request.Since 3.16.0
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-