Class CodeDiagnostic
A diagnostic (error / warning / information) shown in a CodeEditor as a squiggly underline over a
source range, a marker in the line-number gutter and a tooltip carrying the message.
Positions are 1-based: line 1 is the first line and column 1 is the first character of a line,
matching the convention used by most compilers and language servers.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCodeDiagnostic(int line, int column, int endLine, int endColumn, String message) Creates a diagnostic spanning an explicit range.CodeDiagnostic(int line, int column, String message) Creates a single-position diagnostic that underlines from the given column to the end of the token / line. -
Method Summary
Modifier and TypeMethodDescriptionintThe 1-based start column.intThe 1-based end column (exclusive).intThe 1-based end line.intgetLine()The 1-based start line.The message shown in the tooltip.The severity, one of#ERROR,#WARNINGor#INFO.setSeverity(String severity) Sets the severity.
-
Field Details
-
ERROR
-
WARNING
-
INFO
-
-
Constructor Details
-
CodeDiagnostic
Creates a single-position diagnostic that underlines from the given column to the end of the token / line.
Parameters
-
line: the 1-based line -
column: the 1-based start column -
message: the human readable message
-
-
CodeDiagnostic
Creates a diagnostic spanning an explicit range.
Parameters
-
line: the 1-based start line -
column: the 1-based start column -
endLine: the 1-based end line -
endColumn: the 1-based end column (exclusive) -
message: the human readable message
-
-
-
Method Details
-
getLine
public int getLine()The 1-based start line. -
getColumn
public int getColumn()The 1-based start column. -
getEndLine
public int getEndLine()The 1-based end line. -
getEndColumn
public int getEndColumn()The 1-based end column (exclusive). -
getSeverity
The severity, one of#ERROR,#WARNINGor#INFO. -
setSeverity
Sets the severity. Returns this for chaining.
Parameters
severity: one of#ERROR,#WARNING,#INFO
-
getMessage
The message shown in the tooltip.
-