@codingame/monaco-vscode-api 1.79.3 → 1.79.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/extensions.js +1 -1
- package/dist/json.js +17 -10
- package/monaco-editor-treemending.patch +531 -531
- package/package.json +1 -1
package/dist/extensions.js
CHANGED
|
@@ -92,7 +92,7 @@ FileAccess.uriToBrowserUri = function (uri) {
|
|
|
92
92
|
};
|
|
93
93
|
function registerExtension(manifest, defaultNLS) {
|
|
94
94
|
const uuid = generateUuid();
|
|
95
|
-
const location = ( URI.from({ scheme: 'extension',
|
|
95
|
+
const location = ( URI.from({ scheme: 'extension', authority: uuid, path: '/' }));
|
|
96
96
|
const localizedManifest = defaultNLS != null ? localizeManifest(manifest, defaultNLS) : manifest;
|
|
97
97
|
const extension = {
|
|
98
98
|
manifest: localizedManifest,
|
package/dist/json.js
CHANGED
|
@@ -5,6 +5,7 @@ import { IUserDataProfilesService } from 'monaco-editor/esm/vs/platform/userData
|
|
|
5
5
|
import { Extensions } from 'monaco-editor/esm/vs/platform/jsonschemas/common/jsonContributionRegistry.js';
|
|
6
6
|
import { Emitter, Event } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
7
7
|
import { FileAccess } from 'monaco-editor/esm/vs/base/common/network.js';
|
|
8
|
+
import { parse } from 'monaco-editor/esm/vs/base/common/json.js';
|
|
8
9
|
import { Disposable, extensions } from './api.js';
|
|
9
10
|
const registry = ( Registry.as(Extensions.JSONContribution));
|
|
10
11
|
function getDefaultSchemaAssociations() {
|
|
@@ -18,23 +19,27 @@ function getDefaultSchemaAssociations() {
|
|
|
18
19
|
uri: 'vscode://schemas/settings/user'
|
|
19
20
|
}];
|
|
20
21
|
}
|
|
21
|
-
function getExtensionSchemaAssociations() {
|
|
22
|
-
const associations =
|
|
23
|
-
extensions.all.forEach(extension => {
|
|
22
|
+
async function getExtensionSchemaAssociations() {
|
|
23
|
+
const associations = (await Promise.all(( extensions.all.map(async (extension) => {
|
|
24
24
|
const packageJSON = extension.packageJSON;
|
|
25
25
|
const jsonValidation = packageJSON?.contributes?.jsonValidation;
|
|
26
26
|
if (jsonValidation != null) {
|
|
27
27
|
if (Array.isArray(jsonValidation)) {
|
|
28
|
-
jsonValidation.
|
|
28
|
+
return (await Promise.all(( jsonValidation.map(async (jv) => {
|
|
29
29
|
let { fileMatch, url } = jv;
|
|
30
30
|
if (typeof fileMatch === 'string') {
|
|
31
31
|
fileMatch = [fileMatch];
|
|
32
32
|
}
|
|
33
33
|
if (Array.isArray(fileMatch) && typeof url === 'string') {
|
|
34
34
|
let uri = url;
|
|
35
|
+
let schema = null;
|
|
35
36
|
if (uri[0] === '.' && uri[1] === '/') {
|
|
36
37
|
uri = ( FileAccess.uriToBrowserUri(monaco.Uri.joinPath(extension.extensionUri, uri)).toString());
|
|
37
38
|
}
|
|
39
|
+
if (uri.startsWith('blob:')) {
|
|
40
|
+
schema = parse(await (await fetch(decodeURIComponent(uri))).text());
|
|
41
|
+
uri = ( monaco.Uri.joinPath(extension.extensionUri, url).toString());
|
|
42
|
+
}
|
|
38
43
|
fileMatch = ( fileMatch.map(fm => {
|
|
39
44
|
if (fm[0] === '%') {
|
|
40
45
|
fm = fm.replace(/%APP_SETTINGS_HOME%/, '/User');
|
|
@@ -46,12 +51,14 @@ function getExtensionSchemaAssociations() {
|
|
|
46
51
|
}
|
|
47
52
|
return fm;
|
|
48
53
|
}));
|
|
49
|
-
|
|
54
|
+
return [{ fileMatch, uri, schema }];
|
|
50
55
|
}
|
|
51
|
-
|
|
56
|
+
return [];
|
|
57
|
+
})))).flat();
|
|
52
58
|
}
|
|
53
59
|
}
|
|
54
|
-
|
|
60
|
+
return [];
|
|
61
|
+
})))).flat();
|
|
55
62
|
return associations;
|
|
56
63
|
}
|
|
57
64
|
const customSchemaChangeEmitter = new Emitter();
|
|
@@ -76,18 +83,18 @@ function registerJsonSchema(schema) {
|
|
|
76
83
|
});
|
|
77
84
|
}
|
|
78
85
|
function synchronizeJsonSchemas() {
|
|
79
|
-
function updateDiagnosticsOptions() {
|
|
86
|
+
async function updateDiagnosticsOptions() {
|
|
80
87
|
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
|
|
81
88
|
...monaco.languages.json.jsonDefaults.diagnosticsOptions,
|
|
82
89
|
enableSchemaRequest: true,
|
|
83
90
|
schemas: [
|
|
84
91
|
...getJsonSchemas(),
|
|
85
92
|
...getDefaultSchemaAssociations(),
|
|
86
|
-
...getExtensionSchemaAssociations()
|
|
93
|
+
...(await getExtensionSchemaAssociations())
|
|
87
94
|
]
|
|
88
95
|
});
|
|
89
96
|
}
|
|
90
|
-
updateDiagnosticsOptions();
|
|
97
|
+
void updateDiagnosticsOptions();
|
|
91
98
|
const changeEvent = Event.any(extensions.onDidChange, customSchemaChangeEmitter.event, registry.onDidChangeSchema);
|
|
92
99
|
return changeEvent(updateDiagnosticsOptions);
|
|
93
100
|
}
|