@codingame/monaco-vscode-api 1.69.0 → 1.69.3

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/files.js CHANGED
@@ -1,13 +1,13 @@
1
- import { _ as __decorate, a as __param } from './tslib.es6.js';
2
- import { n as format2, o as getServiceMachineId, E as Emitter, p as ResourceQueue, q as isReadableStream, s as peekStream, t as peekReadable, v as bufferToReadable, x as streamToBuffer, y as consumeStream, z as transform, A as isReadableBufferedStream, C as listenStream, D as bufferedStreamToBuffer, F as readableToBuffer, u as unsupported, G as newWriteableBufferStream, H as newWriteableStream } from './missing-services.js';
3
- import { I as IFileService, j as IProductService, S as Services, z as FileChangesEvent, B as FileOperationError, D as hasOpenReadWriteCloseCapability, E as hasReadWriteCapability, G as hasFileReadStreamCapability, H as toFileSystemProviderErrorCode, q as FileSystemProviderErrorCode, J as ensureFileSystemProviderError, F as FileType, a as FilePermission, K as etag, L as FileOperationEvent, M as toFileOperationResult, O as ETAG_DISABLED, P as hasFileAtomicReadCapability, Q as NotModifiedSinceFileOperationError, R as hasFileFolderCopyCapability, T as hasFileCloneCapability, U as FileSystemProviderError, V as createFileSystemProviderError, C as CancellationTokenSource } from './services2.js';
1
+ import { _ as __decorate, a as __param } from './contextkey.js';
2
+ import { o as format2, p as getServiceMachineId, E as Emitter, q as ResourceQueue, s as isReadableStream, t as peekStream, v as peekReadable, x as bufferToReadable, y as streamToBuffer, z as consumeStream, A as transform, C as isReadableBufferedStream, D as listenStream, F as bufferedStreamToBuffer, G as readableToBuffer, u as unsupported, H as newWriteableBufferStream, J as newWriteableStream } from './missing-services.js';
3
+ import { I as IFileService, j as IProductService, S as Services, z as FileSystemProviderError, q as FileSystemProviderErrorCode, B as FileChangesEvent, D as FileOperationError, E as hasOpenReadWriteCloseCapability, G as hasReadWriteCapability, H as hasFileReadStreamCapability, J as toFileSystemProviderErrorCode, K as ensureFileSystemProviderError, F as FileType, a as FilePermission, L as etag, M as FileOperationEvent, O as toFileOperationResult, P as ETAG_DISABLED, Q as hasFileAtomicReadCapability, R as NotModifiedSinceFileOperationError, T as hasFileFolderCopyCapability, U as hasFileCloneCapability, V as createFileSystemProviderError, C as CancellationTokenSource } from './services2.js';
4
4
  import { VSBuffer } from 'monaco-editor/esm/vs/base/common/buffer.js';
5
5
  import { canceled } from 'monaco-editor/esm/vs/base/common/errors.js';
6
6
  import { localize } from 'monaco-editor/esm/vs/nls.js';
7
7
  import { Disposable, toDisposable, dispose, DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
8
8
  import { Promises } from 'monaco-editor/esm/vs/base/common/async.js';
9
9
  import { Iterable } from 'monaco-editor/esm/vs/base/common/iterator.js';
10
- import { isAbsolutePath, extUri, extUriIgnorePathCase, basename, dirname } from 'monaco-editor/esm/vs/base/common/resources.js';
10
+ import { basename, dirname, isAbsolutePath, extUri, extUriIgnorePathCase } from 'monaco-editor/esm/vs/base/common/resources.js';
11
11
  import { TernarySearchTree } from 'monaco-editor/esm/vs/base/common/map.js';
12
12
  import { coalesce } from 'monaco-editor/esm/vs/base/common/arrays.js';
13
13
  import { hash } from 'monaco-editor/esm/vs/base/common/hash.js';
@@ -15,7 +15,7 @@ import { CancellationToken } from 'monaco-editor/esm/vs/base/common/cancellation
15
15
  import { Schemas, RemoteAuthorities } from 'monaco-editor/esm/vs/base/common/network.js';
16
16
  import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
17
17
  import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
18
- import { bh as supportsTelemetry, bi as getTelemetryLevel, bd as DEFAULT_EXTENSION, E as Disposable$1 } from './extHost.js';
18
+ import { bi as supportsTelemetry, bj as getTelemetryLevel, bd as DEFAULT_EXTENSION, E as Disposable$1 } from './extHost.js';
19
19
  import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
20
20
  import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
21
21
  import { isWeb } from 'monaco-editor/esm/vs/base/common/platform.js';
@@ -30,6 +30,227 @@ function getRemoteAuthority(uri) {
30
30
  function getRemoteServerRootPath(product) {
31
31
  return `/${product.quality ?? 'oss'}-${product.commit ?? 'dev'}`;
32
32
  }
33
+ const WEB_EXTENSION_RESOURCE_END_POINT = 'web-extension-resource';
34
+ const IExtensionResourceLoaderService = ( (createDecorator('extensionResourceLoaderService')));
35
+ class AbstractExtensionResourceLoaderService {
36
+ constructor(_fileService, _storageService, _productService, _environmentService, _configurationService) {
37
+ this._fileService = _fileService;
38
+ this._storageService = _storageService;
39
+ this._productService = _productService;
40
+ this._environmentService = _environmentService;
41
+ this._configurationService = _configurationService;
42
+ this._webExtensionResourceEndPoint = `${getRemoteServerRootPath(_productService)}/${WEB_EXTENSION_RESOURCE_END_POINT}/`;
43
+ if (_productService.extensionsGallery) {
44
+ this._extensionGalleryResourceUrlTemplate = _productService.extensionsGallery.resourceUrlTemplate;
45
+ this._extensionGalleryAuthority = this._extensionGalleryResourceUrlTemplate ? this._getExtensionGalleryAuthority(( (URI.parse(this._extensionGalleryResourceUrlTemplate)))) : undefined;
46
+ }
47
+ }
48
+ get supportsExtensionGalleryResources() {
49
+ return this._extensionGalleryResourceUrlTemplate !== undefined;
50
+ }
51
+ getExtensionGalleryResourceURL(galleryExtension, path) {
52
+ if (this._extensionGalleryResourceUrlTemplate) {
53
+ const uri = ( (URI.parse(
54
+ format2(this._extensionGalleryResourceUrlTemplate, { publisher: galleryExtension.publisher, name: galleryExtension.name, version: galleryExtension.version, path: 'extension' })
55
+ )));
56
+ return this._isWebExtensionResourceEndPoint(uri) ? uri.with({ scheme: RemoteAuthorities.getPreferredWebSchema() }) : uri;
57
+ }
58
+ return undefined;
59
+ }
60
+ isExtensionGalleryResource(uri) {
61
+ return this._extensionGalleryAuthority && this._extensionGalleryAuthority === this._getExtensionGalleryAuthority(uri);
62
+ }
63
+ async getExtensionGalleryRequestHeaders() {
64
+ const headers = {
65
+ 'X-Client-Name': `${this._productService.applicationName}${isWeb ? '-web' : ''}`,
66
+ 'X-Client-Version': this._productService.version
67
+ };
68
+ if (supportsTelemetry(this._productService, this._environmentService) && getTelemetryLevel(this._configurationService) === 3 ) {
69
+ headers['X-Machine-Id'] = await this._getServiceMachineId();
70
+ }
71
+ if (this._productService.commit) {
72
+ headers['X-Client-Commit'] = this._productService.commit;
73
+ }
74
+ return headers;
75
+ }
76
+ _getServiceMachineId() {
77
+ if (!this._serviceMachineIdPromise) {
78
+ this._serviceMachineIdPromise = getServiceMachineId(this._environmentService, this._fileService, this._storageService);
79
+ }
80
+ return this._serviceMachineIdPromise;
81
+ }
82
+ _getExtensionGalleryAuthority(uri) {
83
+ if (this._isWebExtensionResourceEndPoint(uri)) {
84
+ return uri.authority;
85
+ }
86
+ const index = uri.authority.indexOf('.');
87
+ return index !== -1 ? uri.authority.substring(index + 1) : undefined;
88
+ }
89
+ _isWebExtensionResourceEndPoint(uri) {
90
+ return uri.path.startsWith(this._webExtensionResourceEndPoint);
91
+ }
92
+ }
93
+ class File$1 {
94
+ constructor(name) {
95
+ this.type = FileType.File;
96
+ this.ctime = Date.now();
97
+ this.mtime = Date.now();
98
+ this.size = 0;
99
+ this.name = name;
100
+ }
101
+ }
102
+ class Directory {
103
+ constructor(name) {
104
+ this.type = FileType.Directory;
105
+ this.ctime = Date.now();
106
+ this.mtime = Date.now();
107
+ this.size = 0;
108
+ this.name = name;
109
+ this.entries = ( (new Map()));
110
+ }
111
+ }
112
+ class InMemoryFileSystemProvider extends Disposable {
113
+ constructor() {
114
+ super(...arguments);
115
+ this.capabilities = 2
116
+ | 1024 ;
117
+ this.onDidChangeCapabilities = Event.None;
118
+ this.root = ( (new Directory('')));
119
+ this._onDidChangeFile = this._register(( (new Emitter())));
120
+ this.onDidChangeFile = this._onDidChangeFile.event;
121
+ this._bufferedChanges = [];
122
+ }
123
+ async stat(resource) {
124
+ return this._lookup(resource, false);
125
+ }
126
+ async readdir(resource) {
127
+ const entry = this._lookupAsDirectory(resource, false);
128
+ const result = [];
129
+ entry.entries.forEach((child, name) => result.push([name, child.type]));
130
+ return result;
131
+ }
132
+ async readFile(resource) {
133
+ const data = this._lookupAsFile(resource, false).data;
134
+ if (data) {
135
+ return data;
136
+ }
137
+ throw new FileSystemProviderError('file not found', FileSystemProviderErrorCode.FileNotFound);
138
+ }
139
+ async writeFile(resource, content, opts) {
140
+ const basename$1 = basename(resource);
141
+ const parent = this._lookupParentDirectory(resource);
142
+ let entry = parent.entries.get(basename$1);
143
+ if (entry instanceof Directory) {
144
+ throw new FileSystemProviderError('file is directory', FileSystemProviderErrorCode.FileIsADirectory);
145
+ }
146
+ if (!entry && !opts.create) {
147
+ throw new FileSystemProviderError('file not found', FileSystemProviderErrorCode.FileNotFound);
148
+ }
149
+ if (entry && opts.create && !opts.overwrite) {
150
+ throw new FileSystemProviderError('file exists already', FileSystemProviderErrorCode.FileExists);
151
+ }
152
+ if (!entry) {
153
+ entry = ( (new File$1(basename$1)));
154
+ parent.entries.set(basename$1, entry);
155
+ this._fireSoon({ type: 1 , resource });
156
+ }
157
+ entry.mtime = Date.now();
158
+ entry.size = content.byteLength;
159
+ entry.data = content;
160
+ this._fireSoon({ type: 0 , resource });
161
+ }
162
+ async rename(from, to, opts) {
163
+ if (!opts.overwrite && this._lookup(to, true)) {
164
+ throw new FileSystemProviderError('file exists already', FileSystemProviderErrorCode.FileExists);
165
+ }
166
+ const entry = this._lookup(from, false);
167
+ const oldParent = this._lookupParentDirectory(from);
168
+ const newParent = this._lookupParentDirectory(to);
169
+ const newName = basename(to);
170
+ oldParent.entries.delete(entry.name);
171
+ entry.name = newName;
172
+ newParent.entries.set(newName, entry);
173
+ this._fireSoon({ type: 2 , resource: from }, { type: 1 , resource: to });
174
+ }
175
+ async delete(resource, opts) {
176
+ const dirname$1 = dirname(resource);
177
+ const basename$1 = basename(resource);
178
+ const parent = this._lookupAsDirectory(dirname$1, false);
179
+ if (parent.entries.has(basename$1)) {
180
+ parent.entries.delete(basename$1);
181
+ parent.mtime = Date.now();
182
+ parent.size -= 1;
183
+ this._fireSoon({ type: 0 , resource: dirname$1 }, { resource, type: 2 });
184
+ }
185
+ }
186
+ async mkdir(resource) {
187
+ if (this._lookup(resource, true)) {
188
+ throw new FileSystemProviderError('file exists already', FileSystemProviderErrorCode.FileExists);
189
+ }
190
+ const basename$1 = basename(resource);
191
+ const dirname$1 = dirname(resource);
192
+ const parent = this._lookupAsDirectory(dirname$1, false);
193
+ const entry = ( (new Directory(basename$1)));
194
+ parent.entries.set(entry.name, entry);
195
+ parent.mtime = Date.now();
196
+ parent.size += 1;
197
+ this._fireSoon({ type: 0 , resource: dirname$1 }, { type: 1 , resource });
198
+ }
199
+ _lookup(uri, silent) {
200
+ const parts = uri.path.split('/');
201
+ let entry = this.root;
202
+ for (const part of parts) {
203
+ if (!part) {
204
+ continue;
205
+ }
206
+ let child;
207
+ if (entry instanceof Directory) {
208
+ child = entry.entries.get(part);
209
+ }
210
+ if (!child) {
211
+ if (!silent) {
212
+ throw new FileSystemProviderError('file not found', FileSystemProviderErrorCode.FileNotFound);
213
+ }
214
+ else {
215
+ return undefined;
216
+ }
217
+ }
218
+ entry = child;
219
+ }
220
+ return entry;
221
+ }
222
+ _lookupAsDirectory(uri, silent) {
223
+ const entry = this._lookup(uri, silent);
224
+ if (entry instanceof Directory) {
225
+ return entry;
226
+ }
227
+ throw new FileSystemProviderError('file not a directory', FileSystemProviderErrorCode.FileNotADirectory);
228
+ }
229
+ _lookupAsFile(uri, silent) {
230
+ const entry = this._lookup(uri, silent);
231
+ if (entry instanceof File$1) {
232
+ return entry;
233
+ }
234
+ throw new FileSystemProviderError('file is a directory', FileSystemProviderErrorCode.FileIsADirectory);
235
+ }
236
+ _lookupParentDirectory(uri) {
237
+ const dirname$1 = dirname(uri);
238
+ return this._lookupAsDirectory(dirname$1, false);
239
+ }
240
+ watch(resource, opts) {
241
+ return Disposable.None;
242
+ }
243
+ _fireSoon(...changes) {
244
+ this._bufferedChanges.push(...changes);
245
+ if (this._fireSoonHandle) {
246
+ clearTimeout(this._fireSoonHandle);
247
+ }
248
+ this._fireSoonHandle = setTimeout(() => {
249
+ this._onDidChangeFile.fire(this._bufferedChanges);
250
+ this._bufferedChanges.length = 0;
251
+ }, 5);
252
+ }
253
+ }
33
254
  async function readFileIntoStream(provider, resource, target, transformer, options, token) {
34
255
  let error = undefined;
35
256
  try {
@@ -1014,227 +1235,6 @@ let FileService = class FileService extends Disposable {
1014
1235
  FileService = ( (__decorate([
1015
1236
  ( (__param(0, ILogService)))
1016
1237
  ], FileService)));
1017
- class File$1 {
1018
- constructor(name) {
1019
- this.type = FileType.File;
1020
- this.ctime = Date.now();
1021
- this.mtime = Date.now();
1022
- this.size = 0;
1023
- this.name = name;
1024
- }
1025
- }
1026
- class Directory {
1027
- constructor(name) {
1028
- this.type = FileType.Directory;
1029
- this.ctime = Date.now();
1030
- this.mtime = Date.now();
1031
- this.size = 0;
1032
- this.name = name;
1033
- this.entries = ( (new Map()));
1034
- }
1035
- }
1036
- class InMemoryFileSystemProvider extends Disposable {
1037
- constructor() {
1038
- super(...arguments);
1039
- this.capabilities = 2
1040
- | 1024 ;
1041
- this.onDidChangeCapabilities = Event.None;
1042
- this.root = ( (new Directory('')));
1043
- this._onDidChangeFile = this._register(( (new Emitter())));
1044
- this.onDidChangeFile = this._onDidChangeFile.event;
1045
- this._bufferedChanges = [];
1046
- }
1047
- async stat(resource) {
1048
- return this._lookup(resource, false);
1049
- }
1050
- async readdir(resource) {
1051
- const entry = this._lookupAsDirectory(resource, false);
1052
- const result = [];
1053
- entry.entries.forEach((child, name) => result.push([name, child.type]));
1054
- return result;
1055
- }
1056
- async readFile(resource) {
1057
- const data = this._lookupAsFile(resource, false).data;
1058
- if (data) {
1059
- return data;
1060
- }
1061
- throw new FileSystemProviderError('file not found', FileSystemProviderErrorCode.FileNotFound);
1062
- }
1063
- async writeFile(resource, content, opts) {
1064
- const basename$1 = basename(resource);
1065
- const parent = this._lookupParentDirectory(resource);
1066
- let entry = parent.entries.get(basename$1);
1067
- if (entry instanceof Directory) {
1068
- throw new FileSystemProviderError('file is directory', FileSystemProviderErrorCode.FileIsADirectory);
1069
- }
1070
- if (!entry && !opts.create) {
1071
- throw new FileSystemProviderError('file not found', FileSystemProviderErrorCode.FileNotFound);
1072
- }
1073
- if (entry && opts.create && !opts.overwrite) {
1074
- throw new FileSystemProviderError('file exists already', FileSystemProviderErrorCode.FileExists);
1075
- }
1076
- if (!entry) {
1077
- entry = ( (new File$1(basename$1)));
1078
- parent.entries.set(basename$1, entry);
1079
- this._fireSoon({ type: 1 , resource });
1080
- }
1081
- entry.mtime = Date.now();
1082
- entry.size = content.byteLength;
1083
- entry.data = content;
1084
- this._fireSoon({ type: 0 , resource });
1085
- }
1086
- async rename(from, to, opts) {
1087
- if (!opts.overwrite && this._lookup(to, true)) {
1088
- throw new FileSystemProviderError('file exists already', FileSystemProviderErrorCode.FileExists);
1089
- }
1090
- const entry = this._lookup(from, false);
1091
- const oldParent = this._lookupParentDirectory(from);
1092
- const newParent = this._lookupParentDirectory(to);
1093
- const newName = basename(to);
1094
- oldParent.entries.delete(entry.name);
1095
- entry.name = newName;
1096
- newParent.entries.set(newName, entry);
1097
- this._fireSoon({ type: 2 , resource: from }, { type: 1 , resource: to });
1098
- }
1099
- async delete(resource, opts) {
1100
- const dirname$1 = dirname(resource);
1101
- const basename$1 = basename(resource);
1102
- const parent = this._lookupAsDirectory(dirname$1, false);
1103
- if (parent.entries.has(basename$1)) {
1104
- parent.entries.delete(basename$1);
1105
- parent.mtime = Date.now();
1106
- parent.size -= 1;
1107
- this._fireSoon({ type: 0 , resource: dirname$1 }, { resource, type: 2 });
1108
- }
1109
- }
1110
- async mkdir(resource) {
1111
- if (this._lookup(resource, true)) {
1112
- throw new FileSystemProviderError('file exists already', FileSystemProviderErrorCode.FileExists);
1113
- }
1114
- const basename$1 = basename(resource);
1115
- const dirname$1 = dirname(resource);
1116
- const parent = this._lookupAsDirectory(dirname$1, false);
1117
- const entry = ( (new Directory(basename$1)));
1118
- parent.entries.set(entry.name, entry);
1119
- parent.mtime = Date.now();
1120
- parent.size += 1;
1121
- this._fireSoon({ type: 0 , resource: dirname$1 }, { type: 1 , resource });
1122
- }
1123
- _lookup(uri, silent) {
1124
- const parts = uri.path.split('/');
1125
- let entry = this.root;
1126
- for (const part of parts) {
1127
- if (!part) {
1128
- continue;
1129
- }
1130
- let child;
1131
- if (entry instanceof Directory) {
1132
- child = entry.entries.get(part);
1133
- }
1134
- if (!child) {
1135
- if (!silent) {
1136
- throw new FileSystemProviderError('file not found', FileSystemProviderErrorCode.FileNotFound);
1137
- }
1138
- else {
1139
- return undefined;
1140
- }
1141
- }
1142
- entry = child;
1143
- }
1144
- return entry;
1145
- }
1146
- _lookupAsDirectory(uri, silent) {
1147
- const entry = this._lookup(uri, silent);
1148
- if (entry instanceof Directory) {
1149
- return entry;
1150
- }
1151
- throw new FileSystemProviderError('file not a directory', FileSystemProviderErrorCode.FileNotADirectory);
1152
- }
1153
- _lookupAsFile(uri, silent) {
1154
- const entry = this._lookup(uri, silent);
1155
- if (entry instanceof File$1) {
1156
- return entry;
1157
- }
1158
- throw new FileSystemProviderError('file is a directory', FileSystemProviderErrorCode.FileIsADirectory);
1159
- }
1160
- _lookupParentDirectory(uri) {
1161
- const dirname$1 = dirname(uri);
1162
- return this._lookupAsDirectory(dirname$1, false);
1163
- }
1164
- watch(resource, opts) {
1165
- return Disposable.None;
1166
- }
1167
- _fireSoon(...changes) {
1168
- this._bufferedChanges.push(...changes);
1169
- if (this._fireSoonHandle) {
1170
- clearTimeout(this._fireSoonHandle);
1171
- }
1172
- this._fireSoonHandle = setTimeout(() => {
1173
- this._onDidChangeFile.fire(this._bufferedChanges);
1174
- this._bufferedChanges.length = 0;
1175
- }, 5);
1176
- }
1177
- }
1178
- const WEB_EXTENSION_RESOURCE_END_POINT = 'web-extension-resource';
1179
- const IExtensionResourceLoaderService = ( (createDecorator('extensionResourceLoaderService')));
1180
- class AbstractExtensionResourceLoaderService {
1181
- constructor(_fileService, _storageService, _productService, _environmentService, _configurationService) {
1182
- this._fileService = _fileService;
1183
- this._storageService = _storageService;
1184
- this._productService = _productService;
1185
- this._environmentService = _environmentService;
1186
- this._configurationService = _configurationService;
1187
- this._webExtensionResourceEndPoint = `${getRemoteServerRootPath(_productService)}/${WEB_EXTENSION_RESOURCE_END_POINT}/`;
1188
- if (_productService.extensionsGallery) {
1189
- this._extensionGalleryResourceUrlTemplate = _productService.extensionsGallery.resourceUrlTemplate;
1190
- this._extensionGalleryAuthority = this._extensionGalleryResourceUrlTemplate ? this._getExtensionGalleryAuthority(( (URI.parse(this._extensionGalleryResourceUrlTemplate)))) : undefined;
1191
- }
1192
- }
1193
- get supportsExtensionGalleryResources() {
1194
- return this._extensionGalleryResourceUrlTemplate !== undefined;
1195
- }
1196
- getExtensionGalleryResourceURL(galleryExtension, path) {
1197
- if (this._extensionGalleryResourceUrlTemplate) {
1198
- const uri = ( (URI.parse(
1199
- format2(this._extensionGalleryResourceUrlTemplate, { publisher: galleryExtension.publisher, name: galleryExtension.name, version: galleryExtension.version, path: 'extension' })
1200
- )));
1201
- return this._isWebExtensionResourceEndPoint(uri) ? uri.with({ scheme: RemoteAuthorities.getPreferredWebSchema() }) : uri;
1202
- }
1203
- return undefined;
1204
- }
1205
- isExtensionGalleryResource(uri) {
1206
- return this._extensionGalleryAuthority && this._extensionGalleryAuthority === this._getExtensionGalleryAuthority(uri);
1207
- }
1208
- async getExtensionGalleryRequestHeaders() {
1209
- const headers = {
1210
- 'X-Client-Name': `${this._productService.applicationName}${isWeb ? '-web' : ''}`,
1211
- 'X-Client-Version': this._productService.version
1212
- };
1213
- if (supportsTelemetry(this._productService, this._environmentService) && getTelemetryLevel(this._configurationService) === 3 ) {
1214
- headers['X-Machine-Id'] = await this._getServiceMachineId();
1215
- }
1216
- if (this._productService.commit) {
1217
- headers['X-Client-Commit'] = this._productService.commit;
1218
- }
1219
- return headers;
1220
- }
1221
- _getServiceMachineId() {
1222
- if (!this._serviceMachineIdPromise) {
1223
- this._serviceMachineIdPromise = getServiceMachineId(this._environmentService, this._fileService, this._storageService);
1224
- }
1225
- return this._serviceMachineIdPromise;
1226
- }
1227
- _getExtensionGalleryAuthority(uri) {
1228
- if (this._isWebExtensionResourceEndPoint(uri)) {
1229
- return uri.authority;
1230
- }
1231
- const index = uri.authority.indexOf('.');
1232
- return index !== -1 ? uri.authority.substring(index + 1) : undefined;
1233
- }
1234
- _isWebExtensionResourceEndPoint(uri) {
1235
- return uri.path.startsWith(this._webExtensionResourceEndPoint);
1236
- }
1237
- }
1238
1238
  let SimpleExtensionResourceLoaderService = class SimpleExtensionResourceLoaderService extends AbstractExtensionResourceLoaderService {
1239
1239
  constructor(fileService, storageService, productService, environmentService, configurationService) {
1240
1240
  super(fileService, storageService, productService, environmentService, configurationService);
@@ -1,5 +1,5 @@
1
- import { _ as __decorate, a as __param } from './tslib.es6.js';
2
- import { a as isProposedApiEnabled, J as IUserDataProfileService, I as IExtensionService, K as IKeyboardLayoutService, L as IPreferencesService, M as ExtensionsRegistry, O as ExtensionMessageCollector, k as IUserDataProfilesService, E as Emitter, P as parse } from './missing-services.js';
1
+ import { _ as __decorate, a as __param } from './contextkey.js';
2
+ import { a as isProposedApiEnabled, K as IUserDataProfileService, I as IExtensionService, L as IKeyboardLayoutService, M as IPreferencesService, h as ExtensionsRegistry, O as ExtensionMessageCollector, l as IUserDataProfilesService, E as Emitter, P as parse } from './missing-services.js';
3
3
  import { KeyCodeUtils, IMMUTABLE_CODE_TO_KEY_CODE } from 'monaco-editor/esm/vs/base/common/keyCodes.js';
4
4
  import { SimpleKeybinding, ScanCodeBinding, ChordKeybinding } from 'monaco-editor/esm/vs/base/common/keybindings.js';
5
5
  import { ContextKeyExpr, IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
@@ -1,158 +1,8 @@
1
1
  import * as monaco from 'monaco-editor';
2
2
 
3
- /**
4
- * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986.
5
- * This class is a simple parser which creates the basic component parts
6
- * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation
7
- * and encoding.
8
- *
9
- * ```txt
10
- * foo://example.com:8042/over/there?name=ferret#nose
11
- * \_/ \______________/\_________/ \_________/ \__/
12
- * | | | | |
13
- * scheme authority path query fragment
14
- * | _____________________|__
15
- * / \ / \
16
- * urn:example:animal:ferret:nose
17
- * ```
18
- */
19
- declare class URI implements UriComponents {
20
- static isUri(thing: any): thing is URI;
21
- /**
22
- * scheme is the 'http' part of 'http://www.example.com/some/path?query#fragment'.
23
- * The part before the first colon.
24
- */
25
- readonly scheme: string;
26
- /**
27
- * authority is the 'www.example.com' part of 'http://www.example.com/some/path?query#fragment'.
28
- * The part between the first double slashes and the next slash.
29
- */
30
- readonly authority: string;
31
- /**
32
- * path is the '/some/path' part of 'http://www.example.com/some/path?query#fragment'.
33
- */
34
- readonly path: string;
35
- /**
36
- * query is the 'query' part of 'http://www.example.com/some/path?query#fragment'.
37
- */
38
- readonly query: string;
39
- /**
40
- * fragment is the 'fragment' part of 'http://www.example.com/some/path?query#fragment'.
41
- */
42
- readonly fragment: string;
43
- /**
44
- * @internal
45
- */
46
- protected constructor(scheme: string, authority?: string, path?: string, query?: string, fragment?: string, _strict?: boolean);
47
- /**
48
- * @internal
49
- */
50
- protected constructor(components: UriComponents);
51
- /**
52
- * Returns a string representing the corresponding file system path of this URI.
53
- * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the
54
- * platform specific path separator.
55
- *
56
- * * Will *not* validate the path for invalid characters and semantics.
57
- * * Will *not* look at the scheme of this URI.
58
- * * The result shall *not* be used for display purposes but for accessing a file on disk.
59
- *
60
- *
61
- * The *difference* to `URI#path` is the use of the platform specific separator and the handling
62
- * of UNC paths. See the below sample of a file-uri with an authority (UNC path).
63
- *
64
- * ```ts
65
- const u = URI.parse('file://server/c$/folder/file.txt')
66
- u.authority === 'server'
67
- u.path === '/shares/c$/file.txt'
68
- u.fsPath === '\\server\c$\folder\file.txt'
69
- ```
70
- *
71
- * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path,
72
- * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working
73
- * with URIs that represent files on disk (`file` scheme).
74
- */
75
- get fsPath(): string;
76
- with(change: {
77
- scheme?: string;
78
- authority?: string | null;
79
- path?: string | null;
80
- query?: string | null;
81
- fragment?: string | null;
82
- }): URI;
83
- /**
84
- * Creates a new URI from a string, e.g. `http://www.example.com/some/path`,
85
- * `file:///usr/home`, or `scheme:with/path`.
86
- *
87
- * @param value A string which represents an URI (see `URI#toString`).
88
- */
89
- static parse(value: string, _strict?: boolean): URI;
90
- /**
91
- * Creates a new URI from a file system path, e.g. `c:\my\files`,
92
- * `/usr/home`, or `\\server\share\some\path`.
93
- *
94
- * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument
95
- * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as**
96
- * `URI.parse('file://' + path)` because the path might contain characters that are
97
- * interpreted (# and ?). See the following sample:
98
- * ```ts
99
- const good = URI.file('/coding/c#/project1');
100
- good.scheme === 'file';
101
- good.path === '/coding/c#/project1';
102
- good.fragment === '';
103
- const bad = URI.parse('file://' + '/coding/c#/project1');
104
- bad.scheme === 'file';
105
- bad.path === '/coding/c'; // path is now broken
106
- bad.fragment === '/project1';
107
- ```
108
- *
109
- * @param path A file system path (see `URI#fsPath`)
110
- */
111
- static file(path: string): URI;
112
- static from(components: {
113
- scheme: string;
114
- authority?: string;
115
- path?: string;
116
- query?: string;
117
- fragment?: string;
118
- }): URI;
119
- /**
120
- * Join a URI path with path fragments and normalizes the resulting path.
121
- *
122
- * @param uri The input URI.
123
- * @param pathFragment The path fragment to add to the URI path.
124
- * @returns The resulting URI.
125
- */
126
- static joinPath(uri: URI, ...pathFragment: string[]): URI;
127
- /**
128
- * Creates a string representation for this URI. It's guaranteed that calling
129
- * `URI.parse` with the result of this function creates an URI which is equal
130
- * to this URI.
131
- *
132
- * * The result shall *not* be used for display purposes but for externalization or transport.
133
- * * The result will be encoded using the percentage encoding and encoding happens mostly
134
- * ignore the scheme-specific encoding rules.
135
- *
136
- * @param skipEncoding Do not encode the result, default is `false`
137
- */
138
- toString(skipEncoding?: boolean): string;
139
- toJSON(): UriComponents;
140
- static revive(data: UriComponents | URI): URI;
141
- static revive(data: UriComponents | URI | undefined): URI | undefined;
142
- static revive(data: UriComponents | URI | null): URI | null;
143
- static revive(data: UriComponents | URI | undefined | null): URI | undefined | null;
144
- }
145
- interface UriComponents {
146
- scheme: string;
147
- authority: string;
148
- path: string;
149
- query: string;
150
- fragment: string;
151
- }
152
-
153
3
  type IEditorOverrideServices = monaco.editor.IEditorOverrideServices
154
4
 
155
- declare function setLanguageConfiguration(resource: URI, getConfiguration: () => Promise<string>): void;
5
+ declare function setLanguageConfiguration(path: string, getConfiguration: () => Promise<string>): void;
156
6
  declare function getServiceOverride(): IEditorOverrideServices;
157
7
 
158
8
  export { getServiceOverride as default, setLanguageConfiguration };