Package org.eclipse.lsp4j
Class Diagnostic
- java.lang.Object
-
- org.eclipse.lsp4j.Diagnostic
-
public class Diagnostic extends java.lang.Object
Represents 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 boolean
equals(java.lang.Object obj)
org.eclipse.lsp4j.jsonrpc.messages.Either<java.lang.String,java.lang.Integer>
getCode()
The diagnostic's code.DiagnosticCodeDescription
getCodeDescription()
An optional property to describe the error code.java.lang.Object
getData()
A data entry field that is preserved between a `textDocument/publishDiagnostics` notification and `textDocument/codeAction` request.java.lang.String
getMessage()
The diagnostic's message.Range
getRange()
The range at which the message appliesjava.util.List<DiagnosticRelatedInformation>
getRelatedInformation()
An array of related diagnostic information, e.g.DiagnosticSeverity
getSeverity()
The diagnostic's severity.java.lang.String
getSource()
A human-readable string describing the source of this diagnostic, e.g.java.util.List<DiagnosticTag>
getTags()
Additional metadata about the diagnostic.int
hashCode()
void
setCode(java.lang.Integer code)
void
setCode(java.lang.String code)
void
setCode(org.eclipse.lsp4j.jsonrpc.messages.Either<java.lang.String,java.lang.Integer> code)
The diagnostic's code.void
setCodeDescription(DiagnosticCodeDescription codeDescription)
An optional property to describe the error code.void
setData(java.lang.Object data)
A data entry field that is preserved between a `textDocument/publishDiagnostics` notification and `textDocument/codeAction` request.void
setMessage(java.lang.String message)
The diagnostic's message.void
setRange(Range range)
The range at which the message appliesvoid
setRelatedInformation(java.util.List<DiagnosticRelatedInformation> relatedInformation)
An array of related diagnostic information, e.g.void
setSeverity(DiagnosticSeverity severity)
The diagnostic's severity.void
setSource(java.lang.String source)
A human-readable string describing the source of this diagnostic, e.g.void
setTags(java.util.List<DiagnosticTag> tags)
Additional metadata about the diagnostic.java.lang.String
toString()
-
-
-
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:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-