mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 18:32:56 +01:00
Remove TS 3.5 compatibility since this project will never use TS 3.5 again ...
This commit is contained in:
parent
6dce21c4e5
commit
c86307ab92
1 changed files with 3 additions and 22 deletions
|
|
@ -15,7 +15,7 @@ import Thenable = monaco.Thenable;
|
||||||
import CancellationToken = monaco.CancellationToken;
|
import CancellationToken = monaco.CancellationToken;
|
||||||
import IDisposable = monaco.IDisposable;
|
import IDisposable = monaco.IDisposable;
|
||||||
|
|
||||||
//#region utils copied and modified from typescript to prevent loading the entire typescriptServices ---
|
//#region utils copied from typescript to prevent loading the entire typescriptServices ---
|
||||||
|
|
||||||
enum IndentStyle {
|
enum IndentStyle {
|
||||||
None = 0,
|
None = 0,
|
||||||
|
|
@ -41,27 +41,8 @@ export function flattenDiagnosticMessageText(diag: string | ts.DiagnosticMessage
|
||||||
result += diag.messageText;
|
result += diag.messageText;
|
||||||
indent++;
|
indent++;
|
||||||
if (diag.next) {
|
if (diag.next) {
|
||||||
const diagAny = diag as any
|
for (const kid of diag.next) {
|
||||||
// Post 3.6 you can iterate through diags
|
result += flattenDiagnosticMessageText(kid, newLine, indent);
|
||||||
if (typeof diagAny.next[Symbol.iterator] === 'function') {
|
|
||||||
for (const kid of diagAny.next) {
|
|
||||||
result += flattenDiagnosticMessageText(kid, newLine, indent);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// In 3.5 and below you iterate through manually, and don't recurse
|
|
||||||
// this is more or less a direct port of the original function from TS 3.5
|
|
||||||
let diagnosticChain = diagAny.next;
|
|
||||||
while (diagnosticChain) {
|
|
||||||
if (indent) {
|
|
||||||
result += newLine;
|
|
||||||
for (let i = 0; i < indent; i++) {
|
|
||||||
result += " ";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
result += diagnosticChain.messageText;
|
|
||||||
indent++;
|
|
||||||
diagnosticChain = diagnosticChain.next;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue