Quellcode durchsuchen

Adopt latest `monaco-json`

Alex Dima vor 4 Jahren
Ursprung
Commit
fb0c77cf75
5 geänderte Dateien mit 18 neuen und 33 gelöschten Zeilen
  1. 10 1
      gulpfile.js
  2. 2 14
      monaco.d.ts
  3. 3 3
      package-lock.json
  4. 1 1
      package.json
  5. 2 14
      website/playground/monaco.d.ts.txt

+ 10 - 1
gulpfile.js

@@ -228,6 +228,11 @@ function addPluginContribs(type) {
 				'define("vs/basic-languages/_.contribution",["require","exports","vs/editor/editor.api"],',
 			);
 
+			contribContents = contribContents.replace(
+				`define('vs/language/json/fillers/monaco-editor-core',[],`,
+				`define('vs/language/json/fillers/monaco-editor-core',['vs/editor/editor.api'],`,
+			);
+
 			extraContent.push(contribContents);
 		});
 
@@ -291,7 +296,7 @@ function ESM_pluginStream(plugin, destinationPath) {
 
 			const info = ts.preProcessFile(contents);
 			for (let i = info.importedFiles.length - 1; i >= 0; i--) {
-				const importText = info.importedFiles[i].fileName;
+				let importText = info.importedFiles[i].fileName;
 				const pos = info.importedFiles[i].pos;
 				const end = info.importedFiles[i].end;
 
@@ -302,6 +307,10 @@ function ESM_pluginStream(plugin, destinationPath) {
 						process.exit(0);
 					}
 
+					if (importText === 'monaco-editor-core') {
+						importText = 'monaco-editor-core/esm/vs/editor/editor.api';
+					}
+
 					const myFileDestPath = path.join(DESTINATION, plugin.modulePrefix, data.relative);
 					const importFilePath = path.join(DESTINATION, importText.substr('monaco-editor-core/esm/'.length));
 					let relativePath = path.relative(path.dirname(myFileDestPath), importFilePath).replace(/\\/g, '/');

+ 2 - 14
monaco.d.ts

@@ -6710,69 +6710,57 @@ declare namespace monaco.languages.json {
          */
         readonly enableSchemaRequest?: boolean;
     }
-
     export interface ModeConfiguration {
         /**
          * Defines whether the built-in documentFormattingEdit provider is enabled.
          */
         readonly documentFormattingEdits?: boolean;
-
         /**
          * Defines whether the built-in documentRangeFormattingEdit provider is enabled.
          */
         readonly documentRangeFormattingEdits?: boolean;
-
         /**
          * Defines whether the built-in completionItemProvider is enabled.
          */
         readonly completionItems?: boolean;
-
         /**
          * Defines whether the built-in hoverProvider is enabled.
          */
         readonly hovers?: boolean;
-
         /**
          * Defines whether the built-in documentSymbolProvider is enabled.
          */
         readonly documentSymbols?: boolean;
-
         /**
          * Defines whether the built-in tokens provider is enabled.
          */
         readonly tokens?: boolean;
-
         /**
          * Defines whether the built-in color provider is enabled.
          */
         readonly colors?: boolean;
-
         /**
          * Defines whether the built-in foldingRange provider is enabled.
          */
         readonly foldingRanges?: boolean;
-
         /**
          * Defines whether the built-in diagnostic provider is enabled.
          */
         readonly diagnostics?: boolean;
-
         /**
          * Defines whether the built-in selection range provider is enabled.
          */
         readonly selectionRanges?: boolean;
-
     }
-
     export interface LanguageServiceDefaults {
+        readonly languageId: string;
         readonly onDidChange: IEvent<LanguageServiceDefaults>;
         readonly diagnosticsOptions: DiagnosticsOptions;
         readonly modeConfiguration: ModeConfiguration;
         setDiagnosticsOptions(options: DiagnosticsOptions): void;
         setModeConfiguration(modeConfiguration: ModeConfiguration): void;
     }
-
-    export var jsonDefaults: LanguageServiceDefaults;
+    export const jsonDefaults: LanguageServiceDefaults;
 }
 
 /*---------------------------------------------------------------------------------------------

+ 3 - 3
package-lock.json

@@ -4019,9 +4019,9 @@
       "dev": true
     },
     "monaco-json": {
-      "version": "2.9.0",
-      "resolved": "https://registry.npmjs.org/monaco-json/-/monaco-json-2.9.0.tgz",
-      "integrity": "sha512-cpFu3qn3lyEk4B5KjD2kfzEf75QZPrOgoTs2VOyydeXdQ+9IjsnR617lYbLldOI6PGkfZMMp771TBkAvWntiMg==",
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/monaco-json/-/monaco-json-3.0.1.tgz",
+      "integrity": "sha512-vus+jwDci/X/9VEgDoTmSx0yTRRFQX5rf4gIGqILLLJZS++Dt6VRz3jHtvo0+Pk7uanRouDI6Nanf7w3ABUDLg==",
       "dev": true
     },
     "monaco-languages": {

+ 1 - 1
package.json

@@ -35,7 +35,7 @@
     "monaco-css": "2.7.0",
     "monaco-editor-core": "0.20.0",
     "monaco-html": "2.7.0",
-    "monaco-json": "2.9.0",
+    "monaco-json": "3.0.1",
     "monaco-languages": "1.10.0",
     "monaco-typescript": "3.7.0",
     "playwright": "1.2.0-next.1596653191842",

+ 2 - 14
website/playground/monaco.d.ts.txt

@@ -6710,69 +6710,57 @@ declare namespace monaco.languages.json {
          */
         readonly enableSchemaRequest?: boolean;
     }
-
     export interface ModeConfiguration {
         /**
          * Defines whether the built-in documentFormattingEdit provider is enabled.
          */
         readonly documentFormattingEdits?: boolean;
-
         /**
          * Defines whether the built-in documentRangeFormattingEdit provider is enabled.
          */
         readonly documentRangeFormattingEdits?: boolean;
-
         /**
          * Defines whether the built-in completionItemProvider is enabled.
          */
         readonly completionItems?: boolean;
-
         /**
          * Defines whether the built-in hoverProvider is enabled.
          */
         readonly hovers?: boolean;
-
         /**
          * Defines whether the built-in documentSymbolProvider is enabled.
          */
         readonly documentSymbols?: boolean;
-
         /**
          * Defines whether the built-in tokens provider is enabled.
          */
         readonly tokens?: boolean;
-
         /**
          * Defines whether the built-in color provider is enabled.
          */
         readonly colors?: boolean;
-
         /**
          * Defines whether the built-in foldingRange provider is enabled.
          */
         readonly foldingRanges?: boolean;
-
         /**
          * Defines whether the built-in diagnostic provider is enabled.
          */
         readonly diagnostics?: boolean;
-
         /**
          * Defines whether the built-in selection range provider is enabled.
          */
         readonly selectionRanges?: boolean;
-
     }
-
     export interface LanguageServiceDefaults {
+        readonly languageId: string;
         readonly onDidChange: IEvent<LanguageServiceDefaults>;
         readonly diagnosticsOptions: DiagnosticsOptions;
         readonly modeConfiguration: ModeConfiguration;
         setDiagnosticsOptions(options: DiagnosticsOptions): void;
         setModeConfiguration(modeConfiguration: ModeConfiguration): void;
     }
-
-    export var jsonDefaults: LanguageServiceDefaults;
+    export const jsonDefaults: LanguageServiceDefaults;
 }
 
 /*---------------------------------------------------------------------------------------------