瀏覽代碼

Fix indentation

Alex Dima 5 年之前
父節點
當前提交
7e5cb3e7ac
共有 3 個文件被更改,包括 41 次插入42 次删除
  1. 14 14
      scripts/runDaily.js
  2. 9 9
      src/languageFeatures.ts
  3. 18 19
      src/monaco.contribution.ts

+ 14 - 14
scripts/runDaily.js

@@ -8,22 +8,22 @@ const { execSync } = require("child_process");
 const { join } = require("path");
 const { readFileSync, writeFileSync } = require("fs");
 
-  // Update to the daily build
-  execSync("npm install --save typescript@next");
+// Update to the daily build
+execSync("npm install --save typescript@next");
 
-  // Update the dts files
-  execSync("npm run import-typescript");
+// Update the dts files
+execSync("npm run import-typescript");
 
-  // Sync the versions
-  const packagePath = join(__dirname, "../package.json");
-  const package = JSON.parse(readFileSync(packagePath, "utf8"));
+// Sync the versions
+const packagePath = join(__dirname, "../package.json");
+const package = JSON.parse(readFileSync(packagePath, "utf8"));
 
-  const tsPackagePath = join(__dirname, "../node_modules/typescript/package.json");
-  const tsPackage = JSON.parse(readFileSync(tsPackagePath, "utf8"));
+const tsPackagePath = join(__dirname, "../node_modules/typescript/package.json");
+const tsPackage = JSON.parse(readFileSync(tsPackagePath, "utf8"));
 
-  // Set the monaco-typescript version to directly match the typescript nightly version
-  package.version = tsPackage.version;
-  writeFileSync(packagePath, JSON.stringify(package), "utf8");
+// Set the monaco-typescript version to directly match the typescript nightly version
+package.version = tsPackage.version;
+writeFileSync(packagePath, JSON.stringify(package), "utf8");
 
-  // Update the dts files
-  execSync("npm run compile");
+// Update the dts files
+execSync("npm run compile");

+ 9 - 9
src/languageFeatures.ts

@@ -25,25 +25,25 @@ enum IndentStyle {
 
 export function flattenDiagnosticMessageText(diag: string | ts.DiagnosticMessageChain | undefined, newLine: string, indent = 0): string {
 	if (typeof diag === "string") {
-			return diag;
+		return diag;
 	}
 	else if (diag === undefined) {
-			return "";
+		return "";
 	}
 	let result = "";
 	if (indent) {
-			result += newLine;
+		result += newLine;
 
-			for (let i = 0; i < indent; i++) {
-					result += "  ";
-			}
+		for (let i = 0; i < indent; i++) {
+			result += "  ";
+		}
 	}
 	result += diag.messageText;
 	indent++;
 	if (diag.next) {
-			for (const kid of diag.next) {
-					result += flattenDiagnosticMessageText(kid, newLine, indent);
-			}
+		for (const kid of diag.next) {
+			result += flattenDiagnosticMessageText(kid, newLine, indent);
+		}
 	}
 	return result;
 }

+ 18 - 19
src/monaco.contribution.ts

@@ -144,15 +144,14 @@ export class LanguageServiceDefaultsImpl implements monaco.languages.typescript.
 
 //#region enums copied from typescript to prevent loading the entire typescriptServices ---
 
-
 enum ModuleKind {
-		None = 0,
-		CommonJS = 1,
-		AMD = 2,
-		UMD = 3,
-		System = 4,
-		ES2015 = 5,
-		ESNext = 99
+	None = 0,
+	CommonJS = 1,
+	AMD = 2,
+	UMD = 3,
+	System = 4,
+	ES2015 = 5,
+	ESNext = 99
 }
 
 enum JsxEmit {
@@ -168,17 +167,17 @@ enum NewLineKind {
 }
 
 enum ScriptTarget {
-		ES3 = 0,
-		ES5 = 1,
-		ES2015 = 2,
-		ES2016 = 3,
-		ES2017 = 4,
-		ES2018 = 5,
-		ES2019 = 6,
-		ES2020 = 7,
-		ESNext = 99,
-		JSON = 100,
-		Latest = ESNext,
+	ES3 = 0,
+	ES5 = 1,
+	ES2015 = 2,
+	ES2016 = 3,
+	ES2017 = 4,
+	ES2018 = 5,
+	ES2019 = 6,
+	ES2020 = 7,
+	ESNext = 99,
+	JSON = 100,
+	Latest = ESNext,
 }
 
 enum ModuleResolutionKind {