@codingame/monaco-vscode-extensions-service-override 3.2.3 → 4.1.0
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/extensions.js +6 -87
- package/override/vs/platform/dialogs/common/dialogs.js +2 -0
- package/package.json +9 -9
- package/_virtual/semver.js +0 -3
- package/external/vscode-semver/semver.js +0 -985
- package/override/vs/workbench/browser/parts/editor/textEditor.weak.js +0 -8
- package/vscode/src/vs/base/common/console.js +0 -59
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +0 -497
- package/vscode/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.js +0 -44
- package/vscode/src/vs/platform/lifecycle/common/lifecycle.js +0 -27
- package/vscode/src/vs/platform/remote/common/managedSocket.js +0 -98
- package/vscode/src/vs/workbench/api/browser/mainThreadAiEmbeddingVector.js +0 -31
- package/vscode/src/vs/workbench/api/browser/mainThreadAiRelatedInformation.js +0 -35
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +0 -227
- package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js +0 -68
- package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +0 -103
- package/vscode/src/vs/workbench/api/browser/mainThreadChat.js +0 -83
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +0 -203
- package/vscode/src/vs/workbench/api/browser/mainThreadChatProvider.js +0 -201
- package/vscode/src/vs/workbench/api/browser/mainThreadChatVariables.js +0 -41
- package/vscode/src/vs/workbench/api/browser/mainThreadClipboard.js +0 -24
- package/vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.js +0 -107
- package/vscode/src/vs/workbench/api/browser/mainThreadCommands.js +0 -98
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +0 -545
- package/vscode/src/vs/workbench/api/browser/mainThreadConfiguration.js +0 -80
- package/vscode/src/vs/workbench/api/browser/mainThreadConsole.js +0 -35
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +0 -578
- package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +0 -424
- package/vscode/src/vs/workbench/api/browser/mainThreadDecorations.js +0 -102
- package/vscode/src/vs/workbench/api/browser/mainThreadDiagnostics.js +0 -69
- package/vscode/src/vs/workbench/api/browser/mainThreadDialogs.js +0 -68
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentContentProviders.js +0 -79
- package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +0 -253
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +0 -370
- package/vscode/src/vs/workbench/api/browser/mainThreadDownloadService.js +0 -22
- package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +0 -41
- package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +0 -414
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +0 -482
- package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +0 -227
- package/vscode/src/vs/workbench/api/browser/mainThreadErrors.js +0 -24
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +0 -317
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.js +0 -208
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +0 -374
- package/vscode/src/vs/workbench/api/browser/mainThreadInlineChat.js +0 -72
- package/vscode/src/vs/workbench/api/browser/mainThreadInteractive.js +0 -28
- package/vscode/src/vs/workbench/api/browser/mainThreadIssueReporter.js +0 -50
- package/vscode/src/vs/workbench/api/browser/mainThreadLabelService.js +0 -27
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +0 -991
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguages.js +0 -78
- package/vscode/src/vs/workbench/api/browser/mainThreadLocalization.js +0 -35
- package/vscode/src/vs/workbench/api/browser/mainThreadLogService.js +0 -78
- package/vscode/src/vs/workbench/api/browser/mainThreadManagedSockets.js +0 -93
- package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +0 -137
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +0 -194
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocuments.js +0 -123
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.js +0 -188
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDto.js +0 -129
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.js +0 -131
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.js +0 -374
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookRenderers.js +0 -25
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +0 -48
- package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +0 -76
- package/vscode/src/vs/workbench/api/browser/mainThreadProfilContentHandlers.js +0 -38
- package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +0 -68
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickDiff.js +0 -42
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickOpen.js +0 -185
- package/vscode/src/vs/workbench/api/browser/mainThreadRemoteConnectionData.js +0 -30
- package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +0 -493
- package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +0 -49
- package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +0 -146
- package/vscode/src/vs/workbench/api/browser/mainThreadSecretState.js +0 -70
- package/vscode/src/vs/workbench/api/browser/mainThreadShare.js +0 -50
- package/vscode/src/vs/workbench/api/browser/mainThreadSpeech.js +0 -99
- package/vscode/src/vs/workbench/api/browser/mainThreadStatusBar.js +0 -53
- package/vscode/src/vs/workbench/api/browser/mainThreadStorage.js +0 -72
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +0 -731
- package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.js +0 -53
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +0 -408
- package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +0 -195
- package/vscode/src/vs/workbench/api/browser/mainThreadTheming.js +0 -24
- package/vscode/src/vs/workbench/api/browser/mainThreadTimeline.js +0 -55
- package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +0 -312
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +0 -223
- package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +0 -110
- package/vscode/src/vs/workbench/api/browser/mainThreadUrls.js +0 -61
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewManager.js +0 -29
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +0 -283
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewViews.js +0 -100
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +0 -135
- package/vscode/src/vs/workbench/api/browser/mainThreadWindow.js +0 -57
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +0 -268
- package/vscode/src/vs/workbench/api/common/shared/dataTransferCache.js +0 -35
- package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +0 -73
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/contributedOpeners.js +0 -83
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +0 -284
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +0 -276
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.js +0 -52
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +0 -1138
- package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.js +0 -41
- package/vscode/src/vs/workbench/services/extensions/common/extensionDevOptions.js +0 -25
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +0 -512
- package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +0 -274
- package/vscode/src/vs/workbench/services/extensions/common/extensionStorageMigration.js +0 -58
- package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +0 -80
- package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +0 -64
- package/vscode/src/vs/workbench/services/extensions/common/lazyCreateExtensionHostManager.js +0 -161
- package/vscode/src/vs/workbench/services/extensions/common/remoteConsoleUtil.js +0 -49
- package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +0 -222
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
3
|
-
import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/language';
|
|
4
|
-
import { IModelService } from 'vscode/vscode/vs/editor/common/services/model';
|
|
5
|
-
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
6
|
-
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
7
|
-
import { Range } from 'vscode/vscode/vs/editor/common/core/range';
|
|
8
|
-
import { ITextModelService } from 'vscode/vscode/vs/editor/common/services/resolverService';
|
|
9
|
-
import { ILanguageStatusService } from 'vscode/vscode/vs/workbench/services/languageStatus/common/languageStatusService';
|
|
10
|
-
import { DisposableStore, DisposableMap } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
11
|
-
|
|
12
|
-
let MainThreadLanguages = class MainThreadLanguages {
|
|
13
|
-
constructor(_extHostContext, _languageService, _modelService, _resolverService, _languageStatusService) {
|
|
14
|
-
this._languageService = _languageService;
|
|
15
|
-
this._modelService = _modelService;
|
|
16
|
-
this._resolverService = _resolverService;
|
|
17
|
-
this._languageStatusService = _languageStatusService;
|
|
18
|
-
this._disposables = ( new DisposableStore());
|
|
19
|
-
this._status = ( new DisposableMap());
|
|
20
|
-
this._proxy = ( _extHostContext.getProxy(ExtHostContext.ExtHostLanguages));
|
|
21
|
-
this._proxy.$acceptLanguageIds(_languageService.getRegisteredLanguageIds());
|
|
22
|
-
this._disposables.add(_languageService.onDidChange(_ => {
|
|
23
|
-
this._proxy.$acceptLanguageIds(_languageService.getRegisteredLanguageIds());
|
|
24
|
-
}));
|
|
25
|
-
}
|
|
26
|
-
dispose() {
|
|
27
|
-
this._disposables.dispose();
|
|
28
|
-
this._status.dispose();
|
|
29
|
-
}
|
|
30
|
-
async $changeLanguage(resource, languageId) {
|
|
31
|
-
if (!this._languageService.isRegisteredLanguageId(languageId)) {
|
|
32
|
-
return Promise.reject(( new Error(`Unknown language id: ${languageId}`)));
|
|
33
|
-
}
|
|
34
|
-
const uri = URI.revive(resource);
|
|
35
|
-
const ref = await this._resolverService.createModelReference(uri);
|
|
36
|
-
try {
|
|
37
|
-
ref.object.textEditorModel.setLanguage(this._languageService.createById(languageId));
|
|
38
|
-
}
|
|
39
|
-
finally {
|
|
40
|
-
ref.dispose();
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
async $tokensAtPosition(resource, position) {
|
|
44
|
-
const uri = URI.revive(resource);
|
|
45
|
-
const model = this._modelService.getModel(uri);
|
|
46
|
-
if (!model) {
|
|
47
|
-
return undefined;
|
|
48
|
-
}
|
|
49
|
-
model.tokenization.tokenizeIfCheap(position.lineNumber);
|
|
50
|
-
const tokens = model.tokenization.getLineTokens(position.lineNumber);
|
|
51
|
-
const idx = tokens.findTokenIndexAtOffset(position.column - 1);
|
|
52
|
-
return {
|
|
53
|
-
type: tokens.getStandardTokenType(idx),
|
|
54
|
-
range: ( new Range(
|
|
55
|
-
position.lineNumber,
|
|
56
|
-
1 + tokens.getStartOffset(idx),
|
|
57
|
-
position.lineNumber,
|
|
58
|
-
1 + tokens.getEndOffset(idx)
|
|
59
|
-
))
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
$setLanguageStatus(handle, status) {
|
|
63
|
-
this._status.get(handle)?.dispose();
|
|
64
|
-
this._status.set(handle, this._languageStatusService.addStatus(status));
|
|
65
|
-
}
|
|
66
|
-
$removeLanguageStatus(handle) {
|
|
67
|
-
this._status.get(handle)?.dispose();
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
MainThreadLanguages = __decorate([
|
|
71
|
-
extHostNamedCustomer(MainContext.MainThreadLanguages),
|
|
72
|
-
( __param(1, ILanguageService)),
|
|
73
|
-
( __param(2, IModelService)),
|
|
74
|
-
( __param(3, ITextModelService)),
|
|
75
|
-
( __param(4, ILanguageStatusService))
|
|
76
|
-
], MainThreadLanguages);
|
|
77
|
-
|
|
78
|
-
export { MainThreadLanguages };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { MainContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
3
|
-
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
4
|
-
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
5
|
-
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files';
|
|
6
|
-
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
7
|
-
import { ILanguagePackService } from 'vscode/vscode/vs/platform/languagePacks/common/languagePacks';
|
|
8
|
-
|
|
9
|
-
let MainThreadLocalization = class MainThreadLocalization extends Disposable {
|
|
10
|
-
constructor(extHostContext, fileService, languagePackService) {
|
|
11
|
-
super();
|
|
12
|
-
this.fileService = fileService;
|
|
13
|
-
this.languagePackService = languagePackService;
|
|
14
|
-
}
|
|
15
|
-
async $fetchBuiltInBundleUri(id, language) {
|
|
16
|
-
try {
|
|
17
|
-
const uri = await this.languagePackService.getBuiltInExtensionTranslationsUri(id, language);
|
|
18
|
-
return uri;
|
|
19
|
-
}
|
|
20
|
-
catch (e) {
|
|
21
|
-
return undefined;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
async $fetchBundleContents(uriComponents) {
|
|
25
|
-
const contents = await this.fileService.readFile(URI.revive(uriComponents));
|
|
26
|
-
return ( contents.value.toString());
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
MainThreadLocalization = __decorate([
|
|
30
|
-
extHostNamedCustomer(MainContext.MainThreadLocalization),
|
|
31
|
-
( __param(1, IFileService)),
|
|
32
|
-
( __param(2, ILanguagePackService))
|
|
33
|
-
], MainThreadLocalization);
|
|
34
|
-
|
|
35
|
-
export { MainThreadLocalization };
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
3
|
-
import { ILoggerService, parseLogLevel, ILogService, LogLevelToString, isLogLevel, log } from 'vscode/vscode/vs/platform/log/common/log';
|
|
4
|
-
import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
|
-
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
6
|
-
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
7
|
-
import { CommandsRegistry } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
8
|
-
import { IEnvironmentService } from 'vscode/vscode/vs/platform/environment/common/environment';
|
|
9
|
-
|
|
10
|
-
let MainThreadLoggerService = class MainThreadLoggerService {
|
|
11
|
-
constructor(extHostContext, loggerService) {
|
|
12
|
-
this.loggerService = loggerService;
|
|
13
|
-
this.disposables = ( new DisposableStore());
|
|
14
|
-
const proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostLogLevelServiceShape));
|
|
15
|
-
this.disposables.add(loggerService.onDidChangeLogLevel(arg => {
|
|
16
|
-
if (isLogLevel(arg)) {
|
|
17
|
-
proxy.$setLogLevel(arg);
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
proxy.$setLogLevel(arg[1], arg[0]);
|
|
21
|
-
}
|
|
22
|
-
}));
|
|
23
|
-
}
|
|
24
|
-
$log(file, messages) {
|
|
25
|
-
const logger = this.loggerService.getLogger(URI.revive(file));
|
|
26
|
-
if (!logger) {
|
|
27
|
-
throw new Error('Create the logger before logging');
|
|
28
|
-
}
|
|
29
|
-
for (const [level, message] of messages) {
|
|
30
|
-
log(logger, level, message);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
async $createLogger(file, options) {
|
|
34
|
-
this.loggerService.createLogger(URI.revive(file), options);
|
|
35
|
-
}
|
|
36
|
-
async $registerLogger(logResource) {
|
|
37
|
-
this.loggerService.registerLogger({
|
|
38
|
-
...logResource,
|
|
39
|
-
resource: URI.revive(logResource.resource)
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
async $deregisterLogger(resource) {
|
|
43
|
-
this.loggerService.deregisterLogger(URI.revive(resource));
|
|
44
|
-
}
|
|
45
|
-
async $setVisibility(resource, visible) {
|
|
46
|
-
this.loggerService.setVisibility(URI.revive(resource), visible);
|
|
47
|
-
}
|
|
48
|
-
$flush(file) {
|
|
49
|
-
const logger = this.loggerService.getLogger(URI.revive(file));
|
|
50
|
-
if (!logger) {
|
|
51
|
-
throw new Error('Create the logger before flushing');
|
|
52
|
-
}
|
|
53
|
-
logger.flush();
|
|
54
|
-
}
|
|
55
|
-
dispose() {
|
|
56
|
-
this.disposables.dispose();
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
MainThreadLoggerService = __decorate([
|
|
60
|
-
extHostNamedCustomer(MainContext.MainThreadLogger),
|
|
61
|
-
( __param(1, ILoggerService))
|
|
62
|
-
], MainThreadLoggerService);
|
|
63
|
-
CommandsRegistry.registerCommand('_extensionTests.setLogLevel', function (accessor, level) {
|
|
64
|
-
const loggerService = accessor.get(ILoggerService);
|
|
65
|
-
const environmentService = accessor.get(IEnvironmentService);
|
|
66
|
-
if (environmentService.isExtensionDevelopment && !!environmentService.extensionTestsLocationURI) {
|
|
67
|
-
const logLevel = parseLogLevel(level);
|
|
68
|
-
if (logLevel !== undefined) {
|
|
69
|
-
loggerService.setLogLevel(logLevel);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
CommandsRegistry.registerCommand('_extensionTests.getLogLevel', function (accessor) {
|
|
74
|
-
const logService = accessor.get(ILogService);
|
|
75
|
-
return LogLevelToString(logService.getLevel());
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
export { MainThreadLoggerService };
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
3
|
-
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
|
-
import { ManagedSocket, connectManagedSocket } from '../../../platform/remote/common/managedSocket.js';
|
|
5
|
-
import { IRemoteSocketFactoryService } from 'vscode/vscode/vs/platform/remote/common/remoteSocketFactoryService';
|
|
6
|
-
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
7
|
-
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
8
|
-
|
|
9
|
-
let MainThreadManagedSockets = class MainThreadManagedSockets extends Disposable {
|
|
10
|
-
constructor(extHostContext, _remoteSocketFactoryService) {
|
|
11
|
-
super();
|
|
12
|
-
this._remoteSocketFactoryService = _remoteSocketFactoryService;
|
|
13
|
-
this._registrations = ( new Map());
|
|
14
|
-
this._remoteSockets = ( new Map());
|
|
15
|
-
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostManagedSockets));
|
|
16
|
-
}
|
|
17
|
-
async $registerSocketFactory(socketFactoryId) {
|
|
18
|
-
const that = this;
|
|
19
|
-
const socketFactory = new (class {
|
|
20
|
-
supports(connectTo) {
|
|
21
|
-
return (connectTo.id === socketFactoryId);
|
|
22
|
-
}
|
|
23
|
-
connect(connectTo, path, query, debugLabel) {
|
|
24
|
-
return ( new Promise((resolve, reject) => {
|
|
25
|
-
if (connectTo.id !== socketFactoryId) {
|
|
26
|
-
return reject(( new Error('Invalid connectTo')));
|
|
27
|
-
}
|
|
28
|
-
const factoryId = connectTo.id;
|
|
29
|
-
that._proxy.$openRemoteSocket(factoryId).then(socketId => {
|
|
30
|
-
const half = {
|
|
31
|
-
onClose: ( new Emitter()),
|
|
32
|
-
onData: ( new Emitter()),
|
|
33
|
-
onEnd: ( new Emitter()),
|
|
34
|
-
};
|
|
35
|
-
that._remoteSockets.set(socketId, half);
|
|
36
|
-
MainThreadManagedSocket.connect(socketId, that._proxy, path, query, debugLabel, half)
|
|
37
|
-
.then(socket => {
|
|
38
|
-
socket.onDidDispose(() => that._remoteSockets.delete(socketId));
|
|
39
|
-
resolve(socket);
|
|
40
|
-
}, err => {
|
|
41
|
-
that._remoteSockets.delete(socketId);
|
|
42
|
-
reject(err);
|
|
43
|
-
});
|
|
44
|
-
}).catch(reject);
|
|
45
|
-
}));
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
this._registrations.set(socketFactoryId, this._remoteSocketFactoryService.register(1 , socketFactory));
|
|
49
|
-
}
|
|
50
|
-
async $unregisterSocketFactory(socketFactoryId) {
|
|
51
|
-
this._registrations.get(socketFactoryId)?.dispose();
|
|
52
|
-
}
|
|
53
|
-
$onDidManagedSocketHaveData(socketId, data) {
|
|
54
|
-
this._remoteSockets.get(socketId)?.onData.fire(data);
|
|
55
|
-
}
|
|
56
|
-
$onDidManagedSocketClose(socketId, error) {
|
|
57
|
-
this._remoteSockets.get(socketId)?.onClose.fire({
|
|
58
|
-
type: 0 ,
|
|
59
|
-
error: error ? ( new Error(error)) : undefined,
|
|
60
|
-
hadError: !!error
|
|
61
|
-
});
|
|
62
|
-
this._remoteSockets.delete(socketId);
|
|
63
|
-
}
|
|
64
|
-
$onDidManagedSocketEnd(socketId) {
|
|
65
|
-
this._remoteSockets.get(socketId)?.onEnd.fire();
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
MainThreadManagedSockets = __decorate([
|
|
69
|
-
extHostNamedCustomer(MainContext.MainThreadManagedSockets),
|
|
70
|
-
( __param(1, IRemoteSocketFactoryService))
|
|
71
|
-
], MainThreadManagedSockets);
|
|
72
|
-
class MainThreadManagedSocket extends ManagedSocket {
|
|
73
|
-
static connect(socketId, proxy, path, query, debugLabel, half) {
|
|
74
|
-
const socket = ( new MainThreadManagedSocket(socketId, proxy, debugLabel, half));
|
|
75
|
-
return connectManagedSocket(socket, path, query, debugLabel, half);
|
|
76
|
-
}
|
|
77
|
-
constructor(socketId, proxy, debugLabel, half) {
|
|
78
|
-
super(debugLabel, half);
|
|
79
|
-
this.socketId = socketId;
|
|
80
|
-
this.proxy = proxy;
|
|
81
|
-
}
|
|
82
|
-
write(buffer) {
|
|
83
|
-
this.proxy.$remoteSocketWrite(this.socketId, buffer);
|
|
84
|
-
}
|
|
85
|
-
closeRemote() {
|
|
86
|
-
this.proxy.$remoteSocketEnd(this.socketId);
|
|
87
|
-
}
|
|
88
|
-
drain() {
|
|
89
|
-
return this.proxy.$remoteSocketDrain(this.socketId);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export { MainThreadManagedSocket, MainThreadManagedSockets };
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
3
|
-
import { toAction } from 'vscode/vscode/vs/base/common/actions';
|
|
4
|
-
import { MainContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
5
|
-
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
6
|
-
import '../../../../../../override/vs/platform/dialogs/common/dialogs.js';
|
|
7
|
-
import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification';
|
|
8
|
-
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
9
|
-
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
10
|
-
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
|
|
11
|
-
import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
|
|
12
|
-
|
|
13
|
-
let MainThreadMessageService = class MainThreadMessageService {
|
|
14
|
-
constructor(extHostContext, _notificationService, _commandService, _dialogService, extensionService) {
|
|
15
|
-
this._notificationService = _notificationService;
|
|
16
|
-
this._commandService = _commandService;
|
|
17
|
-
this._dialogService = _dialogService;
|
|
18
|
-
this.extensionsListener = extensionService.onDidChangeExtensions(e => {
|
|
19
|
-
for (const extension of e.removed) {
|
|
20
|
-
this._notificationService.removeFilter(extension.identifier.value);
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
dispose() {
|
|
25
|
-
this.extensionsListener.dispose();
|
|
26
|
-
}
|
|
27
|
-
$showMessage(severity, message, options, commands) {
|
|
28
|
-
if (options.modal) {
|
|
29
|
-
return this._showModalMessage(severity, message, options.detail, commands, options.useCustom);
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
return this._showMessage(severity, message, commands, options);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
_showMessage(severity, message, commands, options) {
|
|
36
|
-
return ( new Promise(resolve => {
|
|
37
|
-
const primaryActions = ( commands.map(command => toAction({
|
|
38
|
-
id: `_extension_message_handle_${command.handle}`,
|
|
39
|
-
label: command.title,
|
|
40
|
-
enabled: true,
|
|
41
|
-
run: () => {
|
|
42
|
-
resolve(command.handle);
|
|
43
|
-
return Promise.resolve();
|
|
44
|
-
}
|
|
45
|
-
})));
|
|
46
|
-
let source;
|
|
47
|
-
if (options.source) {
|
|
48
|
-
source = {
|
|
49
|
-
label: options.source.label,
|
|
50
|
-
id: options.source.identifier.value
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
if (!source) {
|
|
54
|
-
source = ( localizeWithPath(
|
|
55
|
-
'vs/workbench/api/browser/mainThreadMessageService',
|
|
56
|
-
'defaultSource',
|
|
57
|
-
"Extension"
|
|
58
|
-
));
|
|
59
|
-
}
|
|
60
|
-
const secondaryActions = [];
|
|
61
|
-
if (options.source) {
|
|
62
|
-
secondaryActions.push(toAction({
|
|
63
|
-
id: options.source.identifier.value,
|
|
64
|
-
label: ( localizeWithPath(
|
|
65
|
-
'vs/workbench/api/browser/mainThreadMessageService',
|
|
66
|
-
'manageExtension',
|
|
67
|
-
"Manage Extension"
|
|
68
|
-
)),
|
|
69
|
-
run: () => {
|
|
70
|
-
return this._commandService.executeCommand('_extensions.manage', options.source.identifier.value);
|
|
71
|
-
}
|
|
72
|
-
}));
|
|
73
|
-
}
|
|
74
|
-
const messageHandle = this._notificationService.notify({
|
|
75
|
-
severity,
|
|
76
|
-
message,
|
|
77
|
-
actions: { primary: primaryActions, secondary: secondaryActions },
|
|
78
|
-
source
|
|
79
|
-
});
|
|
80
|
-
Event.once(messageHandle.onDidClose)(() => {
|
|
81
|
-
resolve(undefined);
|
|
82
|
-
});
|
|
83
|
-
}));
|
|
84
|
-
}
|
|
85
|
-
async _showModalMessage(severity, message, detail, commands, useCustom) {
|
|
86
|
-
const buttons = [];
|
|
87
|
-
let cancelButton = undefined;
|
|
88
|
-
for (const command of commands) {
|
|
89
|
-
const button = {
|
|
90
|
-
label: command.title,
|
|
91
|
-
run: () => command.handle
|
|
92
|
-
};
|
|
93
|
-
if (command.isCloseAffordance) {
|
|
94
|
-
cancelButton = button;
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
buttons.push(button);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
if (!cancelButton) {
|
|
101
|
-
if (buttons.length > 0) {
|
|
102
|
-
cancelButton = {
|
|
103
|
-
label: ( localizeWithPath('vs/workbench/api/browser/mainThreadMessageService', 'cancel', "Cancel")),
|
|
104
|
-
run: () => undefined
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
cancelButton = {
|
|
109
|
-
label: ( localizeWithPath(
|
|
110
|
-
'vs/workbench/api/browser/mainThreadMessageService',
|
|
111
|
-
{ key: 'ok', comment: ['&& denotes a mnemonic'] },
|
|
112
|
-
"&&OK"
|
|
113
|
-
)),
|
|
114
|
-
run: () => undefined
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
const { result } = await this._dialogService.prompt({
|
|
119
|
-
type: severity,
|
|
120
|
-
message,
|
|
121
|
-
detail,
|
|
122
|
-
buttons,
|
|
123
|
-
cancelButton,
|
|
124
|
-
custom: useCustom
|
|
125
|
-
});
|
|
126
|
-
return result;
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
MainThreadMessageService = __decorate([
|
|
130
|
-
extHostNamedCustomer(MainContext.MainThreadMessageService),
|
|
131
|
-
( __param(1, INotificationService)),
|
|
132
|
-
( __param(2, ICommandService)),
|
|
133
|
-
( __param(3, IDialogService)),
|
|
134
|
-
( __param(4, IExtensionService))
|
|
135
|
-
], MainThreadMessageService);
|
|
136
|
-
|
|
137
|
-
export { MainThreadMessageService };
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { VSBuffer } from 'vscode/vscode/vs/base/common/buffer';
|
|
3
|
-
import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
|
|
4
|
-
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
5
|
-
import { DisposableStore, dispose } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
6
|
-
import { StopWatch } from 'vscode/vscode/vs/base/common/stopwatch';
|
|
7
|
-
import { assertType } from 'vscode/vscode/vs/base/common/types';
|
|
8
|
-
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
9
|
-
import { CommandsRegistry } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
10
|
-
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
|
|
11
|
-
import { NotebookDto } from './mainThreadNotebookDto.js';
|
|
12
|
-
import { INotebookCellStatusBarService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCellStatusBarService';
|
|
13
|
-
import { INotebookService, SimpleNotebookProviderInfo } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService';
|
|
14
|
-
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
15
|
-
import { SerializableObjectWithBuffers } from 'vscode/vscode/vs/workbench/services/extensions/common/proxyIdentifier';
|
|
16
|
-
import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
17
|
-
import { revive } from 'vscode/vscode/vs/base/common/marshalling';
|
|
18
|
-
import { coalesce } from 'vscode/vscode/vs/base/common/arrays';
|
|
19
|
-
|
|
20
|
-
let MainThreadNotebooks = class MainThreadNotebooks {
|
|
21
|
-
constructor(extHostContext, _notebookService, _cellStatusBarService, _logService) {
|
|
22
|
-
this._notebookService = _notebookService;
|
|
23
|
-
this._cellStatusBarService = _cellStatusBarService;
|
|
24
|
-
this._logService = _logService;
|
|
25
|
-
this._disposables = ( new DisposableStore());
|
|
26
|
-
this._notebookSerializer = ( new Map());
|
|
27
|
-
this._notebookCellStatusBarRegistrations = ( new Map());
|
|
28
|
-
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostNotebook));
|
|
29
|
-
}
|
|
30
|
-
dispose() {
|
|
31
|
-
this._disposables.dispose();
|
|
32
|
-
dispose(( this._notebookSerializer.values()));
|
|
33
|
-
}
|
|
34
|
-
$registerNotebookSerializer(handle, extension, viewType, options, data) {
|
|
35
|
-
const disposables = ( new DisposableStore());
|
|
36
|
-
disposables.add(this._notebookService.registerNotebookSerializer(viewType, extension, {
|
|
37
|
-
options,
|
|
38
|
-
dataToNotebook: async (data) => {
|
|
39
|
-
const sw = ( new StopWatch());
|
|
40
|
-
let result;
|
|
41
|
-
if (data.byteLength === 0 && viewType === 'interactive') {
|
|
42
|
-
result = NotebookDto.fromNotebookDataDto({ cells: [], metadata: {} });
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
const dto = await this._proxy.$dataToNotebook(handle, data, CancellationToken.None);
|
|
46
|
-
result = NotebookDto.fromNotebookDataDto(dto.value);
|
|
47
|
-
}
|
|
48
|
-
this._logService.trace(`[NotebookSerializer] dataToNotebook DONE after ${sw.elapsed()}ms`, {
|
|
49
|
-
viewType,
|
|
50
|
-
extensionId: extension.id.value,
|
|
51
|
-
});
|
|
52
|
-
return result;
|
|
53
|
-
},
|
|
54
|
-
notebookToData: (data) => {
|
|
55
|
-
const sw = ( new StopWatch());
|
|
56
|
-
const result = this._proxy.$notebookToData(handle, ( new SerializableObjectWithBuffers(NotebookDto.toNotebookDataDto(data))), CancellationToken.None);
|
|
57
|
-
this._logService.trace(`[NotebookSerializer] notebookToData DONE after ${sw.elapsed()}`, {
|
|
58
|
-
viewType,
|
|
59
|
-
extensionId: extension.id.value,
|
|
60
|
-
});
|
|
61
|
-
return result;
|
|
62
|
-
},
|
|
63
|
-
save: async (uri, versionId, options, token) => {
|
|
64
|
-
const stat = await this._proxy.$saveNotebook(handle, uri, versionId, options, token);
|
|
65
|
-
return {
|
|
66
|
-
...stat,
|
|
67
|
-
children: undefined,
|
|
68
|
-
resource: uri
|
|
69
|
-
};
|
|
70
|
-
},
|
|
71
|
-
searchInNotebooks: async (textQuery, token, allPriorityInfo) => {
|
|
72
|
-
const contributedType = this._notebookService.getContributedNotebookType(viewType);
|
|
73
|
-
if (!contributedType) {
|
|
74
|
-
return { results: [], limitHit: false };
|
|
75
|
-
}
|
|
76
|
-
const fileNames = contributedType.selectors;
|
|
77
|
-
const includes = ( fileNames.map((selector) => {
|
|
78
|
-
const globPattern = selector.include || selector;
|
|
79
|
-
return ( globPattern.toString());
|
|
80
|
-
}));
|
|
81
|
-
if (!includes.length) {
|
|
82
|
-
return {
|
|
83
|
-
results: [], limitHit: false
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
const thisPriorityInfo = coalesce([{ isFromSettings: false, filenamePatterns: includes }, ...(allPriorityInfo.get(viewType) ?? [])]);
|
|
87
|
-
const otherEditorsPriorityInfo = Array.from(( allPriorityInfo.keys()))
|
|
88
|
-
.flatMap(key => {
|
|
89
|
-
if (key !== viewType) {
|
|
90
|
-
return allPriorityInfo.get(key) ?? [];
|
|
91
|
-
}
|
|
92
|
-
return [];
|
|
93
|
-
});
|
|
94
|
-
const searchComplete = await this._proxy.$searchInNotebooks(handle, textQuery, thisPriorityInfo, otherEditorsPriorityInfo, token);
|
|
95
|
-
const revivedResults = ( searchComplete.results.map(result => {
|
|
96
|
-
const resource = URI.revive(result.resource);
|
|
97
|
-
return {
|
|
98
|
-
resource,
|
|
99
|
-
cellResults: ( result.cellResults.map(e => revive(e)))
|
|
100
|
-
};
|
|
101
|
-
}));
|
|
102
|
-
return { results: revivedResults, limitHit: searchComplete.limitHit };
|
|
103
|
-
}
|
|
104
|
-
}));
|
|
105
|
-
if (data) {
|
|
106
|
-
disposables.add(this._notebookService.registerContributedNotebookType(viewType, data));
|
|
107
|
-
}
|
|
108
|
-
this._notebookSerializer.set(handle, disposables);
|
|
109
|
-
this._logService.trace('[NotebookSerializer] registered notebook serializer', {
|
|
110
|
-
viewType,
|
|
111
|
-
extensionId: extension.id.value,
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
$unregisterNotebookSerializer(handle) {
|
|
115
|
-
this._notebookSerializer.get(handle)?.dispose();
|
|
116
|
-
this._notebookSerializer.delete(handle);
|
|
117
|
-
}
|
|
118
|
-
$emitCellStatusBarEvent(eventHandle) {
|
|
119
|
-
const emitter = this._notebookCellStatusBarRegistrations.get(eventHandle);
|
|
120
|
-
if (emitter instanceof Emitter) {
|
|
121
|
-
emitter.fire(undefined);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
async $registerNotebookCellStatusBarItemProvider(handle, eventHandle, viewType) {
|
|
125
|
-
const that = this;
|
|
126
|
-
const provider = {
|
|
127
|
-
async provideCellStatusBarItems(uri, index, token) {
|
|
128
|
-
const result = await that._proxy.$provideNotebookCellStatusBarItems(handle, uri, index, token);
|
|
129
|
-
return {
|
|
130
|
-
items: result?.items ?? [],
|
|
131
|
-
dispose() {
|
|
132
|
-
if (result) {
|
|
133
|
-
that._proxy.$releaseNotebookCellStatusBarItems(result.cacheId);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
},
|
|
138
|
-
viewType
|
|
139
|
-
};
|
|
140
|
-
if (typeof eventHandle === 'number') {
|
|
141
|
-
const emitter = ( new Emitter());
|
|
142
|
-
this._notebookCellStatusBarRegistrations.set(eventHandle, emitter);
|
|
143
|
-
provider.onDidChangeStatusBarItems = emitter.event;
|
|
144
|
-
}
|
|
145
|
-
const disposable = this._cellStatusBarService.registerCellStatusBarItemProvider(provider);
|
|
146
|
-
this._notebookCellStatusBarRegistrations.set(handle, disposable);
|
|
147
|
-
}
|
|
148
|
-
async $unregisterNotebookCellStatusBarItemProvider(handle, eventHandle) {
|
|
149
|
-
const unregisterThing = (handle) => {
|
|
150
|
-
const entry = this._notebookCellStatusBarRegistrations.get(handle);
|
|
151
|
-
if (entry) {
|
|
152
|
-
this._notebookCellStatusBarRegistrations.get(handle)?.dispose();
|
|
153
|
-
this._notebookCellStatusBarRegistrations.delete(handle);
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
unregisterThing(handle);
|
|
157
|
-
if (typeof eventHandle === 'number') {
|
|
158
|
-
unregisterThing(eventHandle);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
MainThreadNotebooks = __decorate([
|
|
163
|
-
extHostNamedCustomer(MainContext.MainThreadNotebook),
|
|
164
|
-
( __param(1, INotebookService)),
|
|
165
|
-
( __param(2, INotebookCellStatusBarService)),
|
|
166
|
-
( __param(3, ILogService))
|
|
167
|
-
], MainThreadNotebooks);
|
|
168
|
-
CommandsRegistry.registerCommand('_executeDataToNotebook', async (accessor, ...args) => {
|
|
169
|
-
const [notebookType, bytes] = args;
|
|
170
|
-
assertType(typeof notebookType === 'string', 'string');
|
|
171
|
-
assertType(bytes instanceof VSBuffer, 'VSBuffer');
|
|
172
|
-
const notebookService = accessor.get(INotebookService);
|
|
173
|
-
const info = await notebookService.withNotebookDataProvider(notebookType);
|
|
174
|
-
if (!(info instanceof SimpleNotebookProviderInfo)) {
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
const dto = await info.serializer.dataToNotebook(bytes);
|
|
178
|
-
return ( new SerializableObjectWithBuffers(NotebookDto.toNotebookDataDto(dto)));
|
|
179
|
-
});
|
|
180
|
-
CommandsRegistry.registerCommand('_executeNotebookToData', async (accessor, ...args) => {
|
|
181
|
-
const [notebookType, dto] = args;
|
|
182
|
-
assertType(typeof notebookType === 'string', 'string');
|
|
183
|
-
assertType(typeof dto === 'object');
|
|
184
|
-
const notebookService = accessor.get(INotebookService);
|
|
185
|
-
const info = await notebookService.withNotebookDataProvider(notebookType);
|
|
186
|
-
if (!(info instanceof SimpleNotebookProviderInfo)) {
|
|
187
|
-
return;
|
|
188
|
-
}
|
|
189
|
-
const data = NotebookDto.fromNotebookDataDto(dto.value);
|
|
190
|
-
const bytes = await info.serializer.notebookToData(data);
|
|
191
|
-
return bytes;
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
export { MainThreadNotebooks };
|