mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 20:52:56 +01:00
Fix indentation
This commit is contained in:
parent
8e01f87054
commit
7e5cb3e7ac
3 changed files with 41 additions and 42 deletions
|
|
@ -8,22 +8,22 @@ const { execSync } = require("child_process");
|
||||||
const { join } = require("path");
|
const { join } = require("path");
|
||||||
const { readFileSync, writeFileSync } = require("fs");
|
const { readFileSync, writeFileSync } = require("fs");
|
||||||
|
|
||||||
// Update to the daily build
|
// Update to the daily build
|
||||||
execSync("npm install --save typescript@next");
|
execSync("npm install --save typescript@next");
|
||||||
|
|
||||||
// Update the dts files
|
// Update the dts files
|
||||||
execSync("npm run import-typescript");
|
execSync("npm run import-typescript");
|
||||||
|
|
||||||
// Sync the versions
|
// Sync the versions
|
||||||
const packagePath = join(__dirname, "../package.json");
|
const packagePath = join(__dirname, "../package.json");
|
||||||
const package = JSON.parse(readFileSync(packagePath, "utf8"));
|
const package = JSON.parse(readFileSync(packagePath, "utf8"));
|
||||||
|
|
||||||
const tsPackagePath = join(__dirname, "../node_modules/typescript/package.json");
|
const tsPackagePath = join(__dirname, "../node_modules/typescript/package.json");
|
||||||
const tsPackage = JSON.parse(readFileSync(tsPackagePath, "utf8"));
|
const tsPackage = JSON.parse(readFileSync(tsPackagePath, "utf8"));
|
||||||
|
|
||||||
// Set the monaco-typescript version to directly match the typescript nightly version
|
// Set the monaco-typescript version to directly match the typescript nightly version
|
||||||
package.version = tsPackage.version;
|
package.version = tsPackage.version;
|
||||||
writeFileSync(packagePath, JSON.stringify(package), "utf8");
|
writeFileSync(packagePath, JSON.stringify(package), "utf8");
|
||||||
|
|
||||||
// Update the dts files
|
// Update the dts files
|
||||||
execSync("npm run compile");
|
execSync("npm run compile");
|
||||||
|
|
|
||||||
|
|
@ -25,25 +25,25 @@ enum IndentStyle {
|
||||||
|
|
||||||
export function flattenDiagnosticMessageText(diag: string | ts.DiagnosticMessageChain | undefined, newLine: string, indent = 0): string {
|
export function flattenDiagnosticMessageText(diag: string | ts.DiagnosticMessageChain | undefined, newLine: string, indent = 0): string {
|
||||||
if (typeof diag === "string") {
|
if (typeof diag === "string") {
|
||||||
return diag;
|
return diag;
|
||||||
}
|
}
|
||||||
else if (diag === undefined) {
|
else if (diag === undefined) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
let result = "";
|
let result = "";
|
||||||
if (indent) {
|
if (indent) {
|
||||||
result += newLine;
|
result += newLine;
|
||||||
|
|
||||||
for (let i = 0; i < indent; i++) {
|
for (let i = 0; i < indent; i++) {
|
||||||
result += " ";
|
result += " ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result += diag.messageText;
|
result += diag.messageText;
|
||||||
indent++;
|
indent++;
|
||||||
if (diag.next) {
|
if (diag.next) {
|
||||||
for (const kid of diag.next) {
|
for (const kid of diag.next) {
|
||||||
result += flattenDiagnosticMessageText(kid, newLine, indent);
|
result += flattenDiagnosticMessageText(kid, newLine, indent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -144,15 +144,14 @@ export class LanguageServiceDefaultsImpl implements monaco.languages.typescript.
|
||||||
|
|
||||||
//#region enums copied from typescript to prevent loading the entire typescriptServices ---
|
//#region enums copied from typescript to prevent loading the entire typescriptServices ---
|
||||||
|
|
||||||
|
|
||||||
enum ModuleKind {
|
enum ModuleKind {
|
||||||
None = 0,
|
None = 0,
|
||||||
CommonJS = 1,
|
CommonJS = 1,
|
||||||
AMD = 2,
|
AMD = 2,
|
||||||
UMD = 3,
|
UMD = 3,
|
||||||
System = 4,
|
System = 4,
|
||||||
ES2015 = 5,
|
ES2015 = 5,
|
||||||
ESNext = 99
|
ESNext = 99
|
||||||
}
|
}
|
||||||
|
|
||||||
enum JsxEmit {
|
enum JsxEmit {
|
||||||
|
|
@ -168,17 +167,17 @@ enum NewLineKind {
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ScriptTarget {
|
enum ScriptTarget {
|
||||||
ES3 = 0,
|
ES3 = 0,
|
||||||
ES5 = 1,
|
ES5 = 1,
|
||||||
ES2015 = 2,
|
ES2015 = 2,
|
||||||
ES2016 = 3,
|
ES2016 = 3,
|
||||||
ES2017 = 4,
|
ES2017 = 4,
|
||||||
ES2018 = 5,
|
ES2018 = 5,
|
||||||
ES2019 = 6,
|
ES2019 = 6,
|
||||||
ES2020 = 7,
|
ES2020 = 7,
|
||||||
ESNext = 99,
|
ESNext = 99,
|
||||||
JSON = 100,
|
JSON = 100,
|
||||||
Latest = ESNext,
|
Latest = ESNext,
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ModuleResolutionKind {
|
enum ModuleResolutionKind {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue