mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-20 22:51:17 -05:00
Return Diagnostic.category from the server
This commit is contained in:
@@ -1828,6 +1828,11 @@ namespace ts.server.protocol {
|
||||
* The error code of the diagnostic message.
|
||||
*/
|
||||
code?: number;
|
||||
|
||||
/**
|
||||
* The category of the diagnostic message, e.g. "error" vs. "warning"
|
||||
*/
|
||||
category: string;
|
||||
}
|
||||
|
||||
export interface DiagnosticEventBody {
|
||||
|
||||
@@ -67,7 +67,8 @@ namespace ts.server {
|
||||
start: scriptInfo.positionToLineOffset(diag.start),
|
||||
end: scriptInfo.positionToLineOffset(diag.start + diag.length),
|
||||
text: ts.flattenDiagnosticMessageText(diag.messageText, "\n"),
|
||||
code: diag.code
|
||||
code: diag.code,
|
||||
category: DiagnosticCategory[diag.category].toLowerCase()
|
||||
};
|
||||
}
|
||||
|
||||
@@ -75,7 +76,8 @@ namespace ts.server {
|
||||
return {
|
||||
start: undefined,
|
||||
end: undefined,
|
||||
text: ts.flattenDiagnosticMessageText(diag.messageText, "\n")
|
||||
text: ts.flattenDiagnosticMessageText(diag.messageText, "\n"),
|
||||
category: DiagnosticCategory[diag.category].toLowerCase()
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user