@codingame/monaco-vscode-api 2.1.4 → 2.2.0-next.1
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/README.md +2 -0
- package/contributions.js +1 -0
- package/extensions.d.ts +6 -3
- package/extensions.js +18 -7
- package/lifecycle.js +11 -3
- package/missing-services.js +55 -10
- package/monaco.js +7 -3
- package/package.json +8 -8
- package/service-override/tools/views.d.ts +98 -0
- package/service-override/tools/views.js +249 -0
- package/services.d.ts +4 -2
- package/services.js +11 -9
- package/vscode/src/vs/base/browser/deviceAccess.js +60 -0
- package/vscode/src/vs/base/browser/dom.js +18 -1
- package/vscode/src/vs/base/browser/ui/centered/centeredViewLayout.js +178 -0
- package/vscode/src/vs/base/browser/ui/grid/grid.js +492 -0
- package/vscode/src/vs/base/browser/ui/grid/gridview.css.js +4 -0
- package/vscode/src/vs/base/browser/ui/grid/gridview.d.ts +1 -0
- package/vscode/src/vs/base/browser/ui/grid/gridview.js +1109 -0
- package/vscode/src/vs/base/browser/ui/sash/sash.js +9 -1
- package/vscode/src/vs/base/browser/ui/splitview/splitview.d.ts +348 -1
- package/vscode/src/vs/base/common/async.js +46 -2
- package/vscode/src/vs/base/common/codicons.d.ts +579 -0
- package/vscode/src/vs/base/common/event.js +11 -2
- package/vscode/src/vs/base/common/keybindingParser.js +87 -0
- package/vscode/src/vs/base/common/network.js +1 -2
- package/vscode/src/vs/base/common/observableInternal/utils.js +1 -1
- package/vscode/src/vs/base/common/platform.js +2 -1
- package/vscode/src/vs/base/common/scrollable.d.ts +28 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/colors.js +17 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/diffEditorItemTemplate.js +214 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/multiDiffEditorViewModel.js +84 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/multiDiffEditorWidget.js +54 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/multiDiffEditorWidgetImpl.js +324 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/objectPool.js +46 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/style.css.js +4 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/utils.js +11 -0
- package/vscode/src/vs/platform/keyboardLayout/common/keyboardLayout.js +61 -1
- package/vscode/src/vs/platform/languagePacks/common/localizedStrings.js +10 -0
- package/vscode/src/vs/platform/log/browser/log.js +24 -0
- package/vscode/src/vs/platform/product/common/product.js +1 -2
- package/vscode/src/vs/platform/userDataSync/common/abstractSynchronizer.js +772 -0
- package/vscode/src/vs/platform/userDataSync/common/userDataSyncStoreService.js +551 -0
- package/vscode/src/vs/platform/webview/common/mimeTypes.js +22 -0
- package/vscode/src/vs/platform/webview/common/webviewPortMapping.js +62 -0
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +788 -0
- package/vscode/src/vs/workbench/browser/actions/listCommands.js +763 -0
- package/vscode/src/vs/workbench/browser/layout.d.ts +26 -0
- package/vscode/src/vs/workbench/browser/media/style.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +610 -0
- package/vscode/src/vs/workbench/browser/parts/activitybar/media/activityaction.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +148 -0
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/compositeBar.js +603 -0
- package/vscode/src/vs/workbench/browser/parts/compositePart.js +333 -0
- package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +221 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +1406 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +184 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +509 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorPane.d.ts +112 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +1018 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +389 -0
- package/vscode/src/vs/workbench/browser/parts/editor/media/editordroptarget.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/media/compositepart.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/media/paneCompositePart.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsActions.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsCenter.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsList.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsToasts.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsActions.js +213 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsAlerts.js +73 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCenter.js +307 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsList.js +226 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsStatus.js +218 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsToasts.js +433 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsViewer.js +436 -0
- package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +643 -0
- package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +377 -0
- package/vscode/src/vs/workbench/browser/parts/paneCompositePartService.js +66 -0
- package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +144 -0
- package/vscode/src/vs/workbench/browser/parts/sidebar/media/sidebarpart.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +220 -0
- package/vscode/src/vs/workbench/browser/window.js +239 -5
- package/vscode/src/vs/workbench/common/configuration.js +11 -1
- package/vscode/src/vs/workbench/common/theme.js +3 -3
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +298 -0
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +363 -0
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +133 -0
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/media/callHierarchy.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentGlyphWidget.js +90 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentMenus.js +43 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentService.js +317 -2
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadRangeDecorator.js +107 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +395 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/comments.js +3 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +1277 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsFilterOptions.js +17 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsModel.js +123 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +342 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +451 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsViewActions.js +176 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/media/panel.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/comments/common/commentModel.js +35 -0
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js +16 -0
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +143 -0
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +212 -0
- package/vscode/src/vs/workbench/contrib/customEditor/browser/media/customEditor.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +76 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.js +61 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +117 -0
- package/vscode/src/vs/workbench/contrib/editSessions/common/editSessions.js +62 -0
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.js +5 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/binaryFileEditor.js +77 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/fileEditorHandler.js +72 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditor.js +254 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditorTracker.js +97 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +442 -0
- package/vscode/src/vs/workbench/contrib/files/browser/explorerService.js +430 -0
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js +784 -0
- package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +487 -0
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +521 -0
- package/vscode/src/vs/workbench/contrib/files/browser/workspaceWatcher.js +150 -0
- package/vscode/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.js +61 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveDocumentService.js +25 -1
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +178 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveHistoryService.js +49 -0
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +408 -0
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/media/languageStatus.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.js +145 -0
- package/vscode/src/vs/workbench/contrib/mappedEdits/common/mappedEdits.contribution.js +22 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +691 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +238 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +76 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorSerializer.js +40 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +69 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +346 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.js +96 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +144 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +103 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +399 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +195 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/fixedZoneWidget.js +39 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/lineAlignment.js +126 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/media/mergeEditor.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +611 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +156 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +262 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewZones.js +171 -0
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService.js +41 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +317 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/notebookVisibleCellObserver.js +56 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +315 -0
- package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.js +193 -0
- package/vscode/src/vs/workbench/contrib/preferences/common/preferences.js +2 -1
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.js +37 -0
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.js +39 -0
- package/vscode/src/vs/workbench/contrib/speech/common/speechService.js +138 -2
- package/vscode/src/vs/workbench/contrib/tags/browser/workspaceTagsService.js +12 -0
- package/vscode/src/vs/workbench/contrib/tags/common/workspaceTags.js +3 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/media/typeHierarchy.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +281 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +358 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +131 -0
- package/vscode/src/vs/workbench/contrib/update/common/update.js +2 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.js +288 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.js +94 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/themeing.js +86 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webview.contribution.js +77 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +646 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.js +63 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewService.js +57 -0
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +140 -0
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInputSerializer.js +119 -0
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +67 -0
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +233 -0
- package/vscode/src/vs/workbench/services/activity/browser/activityService.js +143 -0
- package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +0 -3
- package/vscode/src/vs/workbench/services/driver/browser/driver.js +184 -0
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +668 -0
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +1482 -0
- package/vscode/src/vs/workbench/services/layout/browser/layoutService.js +17 -1
- package/vscode/src/vs/workbench/services/lifecycle/common/lifecycle.js +8 -1
- package/vscode/src/vs/workbench/services/progress/browser/media/progressService.css.js +4 -0
- package/vscode/src/vs/workbench/services/progress/browser/progressService.js +521 -0
- package/vscode/src/vs/workbench/services/textMate/common/TMGrammars.js +102 -0
- package/vscode/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +296 -0
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.js +99 -0
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +711 -0
- package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +596 -0
package/README.md
CHANGED
|
@@ -194,6 +194,8 @@ Additionally, several packages that include the VSCode version of some services
|
|
|
194
194
|
- Support for the outline view. *Hint*: It only makes sense to enable it when *Views* service is used.
|
|
195
195
|
- **Timeline**: `@codingame/monaco-vscode-timeline-service-override`
|
|
196
196
|
- Support for the timeline view. *Hint*: It only makes sense to enable it when *Views* service is used.
|
|
197
|
+
- **Workbench**: `@codingame/monaco-vscode-workbench-service-override`
|
|
198
|
+
- Allows to render the full workbench layout. Is exclusive with the `views` service. Do not use both services at the same time.
|
|
197
199
|
|
|
198
200
|
Usage:
|
|
199
201
|
|
package/contributions.js
CHANGED
|
@@ -26,6 +26,7 @@ import './vscode/src/vs/workbench/contrib/codeActions/browser/codeActions.contri
|
|
|
26
26
|
import './vscode/src/vs/workbench/contrib/list/browser/list.contribution.js';
|
|
27
27
|
import './vscode/src/vs/workbench/contrib/codeEditor/browser/editorFeatures.js';
|
|
28
28
|
import './vscode/src/vs/workbench/contrib/contextmenu/browser/contextmenu.contribution.js';
|
|
29
|
+
import './vscode/src/vs/workbench/contrib/mappedEdits/common/mappedEdits.contribution.js';
|
|
29
30
|
let ExtensionPoints = class ExtensionPoints {
|
|
30
31
|
constructor(instantiationService) {
|
|
31
32
|
this.instantiationService = instantiationService;
|
package/extensions.d.ts
CHANGED
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
/// <reference path="./vscode-dts/vscode.proposed.windowActivity.d.ts" />
|
|
87
87
|
/// <reference path="./vscode-dts/vscode.proposed.workspaceTrust.d.ts" />
|
|
88
88
|
import * as vscode from 'vscode';
|
|
89
|
-
import { IExtensionManifest } from './vscode/src/vs/platform/extensions/common/extensions.js';
|
|
89
|
+
import { IExtension, IExtensionManifest } from './vscode/src/vs/platform/extensions/common/extensions.js';
|
|
90
90
|
export { IExtensionContributions } from './vscode/src/vs/platform/extensions/common/extensions.js';
|
|
91
91
|
import { IDisposable } from './vscode/src/vs/base/common/lifecycle.js';
|
|
92
92
|
export { ITranslations } from './vscode/src/vs/platform/extensionManagement/common/extensionNls.js';
|
|
@@ -95,8 +95,10 @@ import { ExtensionHostKind } from './vscode/src/vs/workbench/services/extensions
|
|
|
95
95
|
type ApiFactory = (extensionId?: string) => Promise<typeof vscode>;
|
|
96
96
|
declare function registerLocalApiFactory(_apiFactory: ApiFactory): void;
|
|
97
97
|
interface RegisterExtensionParams {
|
|
98
|
-
builtin?: boolean;
|
|
99
98
|
path?: string;
|
|
99
|
+
system?: boolean;
|
|
100
|
+
readmePath?: string;
|
|
101
|
+
changelogPath?: string;
|
|
100
102
|
}
|
|
101
103
|
interface RegisterRemoteExtensionParams extends RegisterExtensionParams {
|
|
102
104
|
path: string;
|
|
@@ -116,9 +118,10 @@ interface RegisterLocalProcessExtensionResult extends RegisterLocalExtensionResu
|
|
|
116
118
|
setAsDefaultApi(): Promise<void>;
|
|
117
119
|
}
|
|
118
120
|
declare function registerRemoteExtension(directory: string): Promise<RegisterRemoteExtensionResult>;
|
|
121
|
+
declare function getExtensionManifests(): IExtension[];
|
|
119
122
|
declare function registerExtension(manifest: IExtensionManifest, extHostKind: ExtensionHostKind.LocalProcess, params?: RegisterExtensionParams): RegisterLocalProcessExtensionResult;
|
|
120
123
|
declare function registerExtension(manifest: IExtensionManifest, extHostKind: ExtensionHostKind.LocalWebWorker, params?: RegisterExtensionParams): RegisterLocalExtensionResult;
|
|
121
124
|
declare function registerExtension(manifest: IExtensionManifest, extHostKind: ExtensionHostKind.Remote, params?: RegisterRemoteExtensionParams): RegisterRemoteExtensionResult;
|
|
122
125
|
declare function registerExtension(manifest: IExtensionManifest, extHostKind?: ExtensionHostKind, params?: RegisterExtensionParams): RegisterExtensionResult;
|
|
123
126
|
|
|
124
|
-
export { type ApiFactory, ExtensionHostKind, IExtensionManifest, registerExtension, registerLocalApiFactory, registerRemoteExtension };
|
|
127
|
+
export { type ApiFactory, ExtensionHostKind, IExtensionManifest, getExtensionManifests, registerExtension, registerLocalApiFactory, registerRemoteExtension };
|
package/extensions.js
CHANGED
|
@@ -49,8 +49,11 @@ async function registerRemoteExtension(directory) {
|
|
|
49
49
|
const manifest = parse(( content.value.toString()));
|
|
50
50
|
return registerExtension(manifest, 3 , { path: directory });
|
|
51
51
|
}
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
const extensions = [];
|
|
53
|
+
function getExtensionManifests() {
|
|
54
|
+
return extensions;
|
|
55
|
+
}
|
|
56
|
+
function registerExtension(manifest, extHostKind, { path = '/', system = false, readmePath, changelogPath } = {}) {
|
|
54
57
|
const id = getExtensionId(manifest.publisher, manifest.name);
|
|
55
58
|
const location = ( URI.from({ scheme: CustomSchemas.extensionFile, authority: id, path }));
|
|
56
59
|
const addExtensionPromise = (async () => {
|
|
@@ -64,15 +67,20 @@ function registerExtension(manifest, extHostKind, { builtin = manifest.publisher
|
|
|
64
67
|
const localizedManifest = await translator.translateManifest(realLocation, manifest);
|
|
65
68
|
const extension = {
|
|
66
69
|
manifest: localizedManifest,
|
|
67
|
-
type:
|
|
68
|
-
isBuiltin:
|
|
70
|
+
type: system ? 0 : 1 ,
|
|
71
|
+
isBuiltin: true,
|
|
69
72
|
identifier: { id },
|
|
70
73
|
location: realLocation,
|
|
71
74
|
targetPlatform: "web" ,
|
|
72
75
|
isValid: true,
|
|
73
76
|
validations: [],
|
|
74
|
-
extHostKind
|
|
77
|
+
extHostKind,
|
|
78
|
+
readmeUrl: readmePath != null ? URI.joinPath(realLocation, readmePath) : undefined,
|
|
79
|
+
changelogUrl: changelogPath != null ? URI.joinPath(realLocation, changelogPath) : undefined
|
|
75
80
|
};
|
|
81
|
+
if (extHostKind !== 3 ) {
|
|
82
|
+
extensions.push(extension);
|
|
83
|
+
}
|
|
76
84
|
await deltaExtensions({ toAdd: [extension], toRemove: [] });
|
|
77
85
|
return extension;
|
|
78
86
|
})();
|
|
@@ -83,8 +91,11 @@ function registerExtension(manifest, extHostKind, { builtin = manifest.publisher
|
|
|
83
91
|
},
|
|
84
92
|
async dispose() {
|
|
85
93
|
const extension = await addExtensionPromise;
|
|
94
|
+
const index = extensions.indexOf(extension);
|
|
95
|
+
if (index >= 0) {
|
|
96
|
+
extensions.splice(extensions.indexOf(extension), 1);
|
|
97
|
+
}
|
|
86
98
|
await deltaExtensions({ toAdd: [], toRemove: [extension] });
|
|
87
|
-
disposableStore.dispose();
|
|
88
99
|
}
|
|
89
100
|
};
|
|
90
101
|
if (extHostKind !== 3 ) {
|
|
@@ -114,4 +125,4 @@ function registerExtension(manifest, extHostKind, { builtin = manifest.publisher
|
|
|
114
125
|
}
|
|
115
126
|
return api;
|
|
116
127
|
}
|
|
117
|
-
export { registerExtension, registerLocalApiFactory, registerRemoteExtension };
|
|
128
|
+
export { getExtensionManifests, registerExtension, registerLocalApiFactory, registerRemoteExtension };
|
package/lifecycle.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { Registry } from './vscode/src/vs/platform/registry/common/platform.js';
|
|
2
2
|
import { Extensions } from './vscode/src/vs/workbench/common/contributions.js';
|
|
3
3
|
import { ILifecycleService } from './vscode/src/vs/workbench/services/lifecycle/common/lifecycle.js';
|
|
4
|
-
import { Barrier, RunOnceScheduler, _runWhenIdle } from './vscode/src/vs/base/common/async.js';
|
|
4
|
+
import { Barrier, timeout, RunOnceScheduler, _runWhenIdle } from './vscode/src/vs/base/common/async.js';
|
|
5
5
|
import { Emitter } from './vscode/src/vs/base/common/event.js';
|
|
6
6
|
import { EditorExtensions } from './vscode/src/vs/workbench/common/editor.js';
|
|
7
7
|
import { StandaloneServices } from './vscode/src/vs/editor/standalone/browser/standaloneServices.js';
|
|
8
8
|
import { Disposable } from './vscode/src/vs/base/common/lifecycle.js';
|
|
9
|
+
import { IWorkbenchLayoutService } from './vscode/src/vs/workbench/services/layout/browser/layoutService.js';
|
|
10
|
+
const layoutEmitter = new Emitter();
|
|
11
|
+
const onLayout = layoutEmitter.event;
|
|
9
12
|
const renderWorkbenchEmitter = new Emitter();
|
|
10
13
|
const onRenderWorkbench = renderWorkbenchEmitter.event;
|
|
11
14
|
const serviceInitializedBarrier = new Barrier();
|
|
@@ -36,11 +39,16 @@ async function startup(instantiationService) {
|
|
|
36
39
|
});
|
|
37
40
|
serviceInitializedBarrier.open();
|
|
38
41
|
serviceInitializedEmitter.fire();
|
|
39
|
-
instantiationService.invokeFunction(accessor => {
|
|
42
|
+
void instantiationService.invokeFunction(async (accessor) => {
|
|
40
43
|
const lifecycleService = accessor.get(ILifecycleService);
|
|
41
44
|
( Registry.as(Extensions.Workbench)).start(accessor);
|
|
42
45
|
( Registry.as(EditorExtensions.EditorFactory)).start(accessor);
|
|
46
|
+
layoutEmitter.fire(accessor);
|
|
43
47
|
renderWorkbenchEmitter.fire(accessor);
|
|
48
|
+
await Promise.race([
|
|
49
|
+
accessor.get(IWorkbenchLayoutService).whenRestored,
|
|
50
|
+
timeout(2000)
|
|
51
|
+
]);
|
|
44
52
|
lifecycleService.phase = 3 ;
|
|
45
53
|
const eventuallyPhaseScheduler = new RunOnceScheduler(() => {
|
|
46
54
|
_runWhenIdle(window, () => {
|
|
@@ -68,4 +76,4 @@ function checkServicesNotInitialized() {
|
|
|
68
76
|
throw new Error('Services are already initialized');
|
|
69
77
|
}
|
|
70
78
|
}
|
|
71
|
-
export { checkServicesNotInitialized, checkServicesReady, onRenderWorkbench, registerServiceInitializeParticipant, registerServiceInitializePostParticipant, registerServiceInitializePreParticipant, serviceInitializedBarrier, serviceInitializedEmitter, startup, waitServicesReady };
|
|
79
|
+
export { checkServicesNotInitialized, checkServicesReady, onLayout, onRenderWorkbench, registerServiceInitializeParticipant, registerServiceInitializePostParticipant, registerServiceInitializePreParticipant, serviceInitializedBarrier, serviceInitializedEmitter, startup, waitServicesReady };
|
package/missing-services.js
CHANGED
|
@@ -26,7 +26,7 @@ import { IContextKeyService } from './vscode/src/vs/platform/contextkey/common/c
|
|
|
26
26
|
import { StandaloneServices } from './vscode/src/vs/editor/standalone/browser/standaloneServices.js';
|
|
27
27
|
import { ICodeEditorService } from './vscode/src/vs/editor/browser/services/codeEditorService.js';
|
|
28
28
|
import { IUserDataProfilesService, toUserDataProfile } from './vscode/src/vs/platform/userDataProfile/common/userDataProfile.js';
|
|
29
|
-
import { IPolicyService } from './vscode/src/vs/platform/policy/common/policy.js';
|
|
29
|
+
import { NullPolicyService, IPolicyService } from './vscode/src/vs/platform/policy/common/policy.js';
|
|
30
30
|
import { IUserDataProfileService, IUserDataProfileImportExportService, IUserDataProfileManagementService } from './vscode/src/vs/workbench/services/userDataProfile/common/userDataProfile.js';
|
|
31
31
|
import { UserDataProfileService } from './vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileService.js';
|
|
32
32
|
import { ISnippetsService } from './vscode/src/vs/workbench/contrib/snippets/browser/snippets.js';
|
|
@@ -186,6 +186,11 @@ import { IInlineChatSessionService } from './vscode/src/vs/workbench/contrib/inl
|
|
|
186
186
|
import { IInlineChatSavingService } from './vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingService.js';
|
|
187
187
|
import { INotebookDocumentService } from './vscode/src/vs/workbench/services/notebook/common/notebookDocumentService.js';
|
|
188
188
|
import { IDebugVisualizerService } from './vscode/src/vs/workbench/contrib/debug/common/debugVisualizers.js';
|
|
189
|
+
import { IEditSessionsLogService, IEditSessionsStorageService } from './vscode/src/vs/workbench/contrib/editSessions/common/editSessions.js';
|
|
190
|
+
import { IMultiDiffSourceResolverService } from './vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService.js';
|
|
191
|
+
import { IInteractiveHistoryService } from './vscode/src/vs/workbench/contrib/interactive/browser/interactiveHistoryService.js';
|
|
192
|
+
import { IWorkspaceTagsService } from './vscode/src/vs/workbench/contrib/tags/common/workspaceTags.js';
|
|
193
|
+
import { NoOpWorkspaceTagsService } from './vscode/src/vs/workbench/contrib/tags/browser/workspaceTagsService.js';
|
|
189
194
|
import { unsupported } from './tools.js';
|
|
190
195
|
import { getBuiltInExtensionTranslationsUris } from './l10n.js';
|
|
191
196
|
import { IFileDialogService } from './vscode/src/vs/platform/dialogs/common/dialogs.js';
|
|
@@ -680,15 +685,7 @@ InjectedUserDataProfileService = __decorate([
|
|
|
680
685
|
( __param(0, IEnvironmentService))
|
|
681
686
|
], InjectedUserDataProfileService);
|
|
682
687
|
registerSingleton(IUserDataProfileService, InjectedUserDataProfileService, 0 );
|
|
683
|
-
registerSingleton(IPolicyService,
|
|
684
|
-
constructor() {
|
|
685
|
-
this.updatePolicyDefinitions = unsupported;
|
|
686
|
-
this.onDidChange = Event.None;
|
|
687
|
-
this.registerPolicyDefinitions = unsupported;
|
|
688
|
-
this.getPolicyValue = () => undefined;
|
|
689
|
-
this.serialize = () => undefined;
|
|
690
|
-
}
|
|
691
|
-
}, 0 );
|
|
688
|
+
registerSingleton(IPolicyService, NullPolicyService, 0 );
|
|
692
689
|
registerSingleton(ISnippetsService, class SnippetsService {
|
|
693
690
|
constructor() {
|
|
694
691
|
this.getSnippetFiles = unsupported;
|
|
@@ -2271,6 +2268,16 @@ registerSingleton(INotebookRendererMessagingService, class NotebookRendererMessa
|
|
|
2271
2268
|
this.receiveMessage = unsupported;
|
|
2272
2269
|
}
|
|
2273
2270
|
}, 1 );
|
|
2271
|
+
registerSingleton(IInteractiveHistoryService, class InteractiveHistoryService {
|
|
2272
|
+
constructor() {
|
|
2273
|
+
this.addToHistory = unsupported;
|
|
2274
|
+
this.getPreviousValue = unsupported;
|
|
2275
|
+
this.getNextValue = unsupported;
|
|
2276
|
+
this.replaceLast = unsupported;
|
|
2277
|
+
this.clearHistory = unsupported;
|
|
2278
|
+
this.has = unsupported;
|
|
2279
|
+
}
|
|
2280
|
+
}, 1 );
|
|
2274
2281
|
registerSingleton(IInteractiveDocumentService, class InteractiveDocumentService {
|
|
2275
2282
|
constructor() {
|
|
2276
2283
|
this.onWillAddInteractiveDocument = Event.None;
|
|
@@ -2930,3 +2937,41 @@ registerSingleton(IDebugVisualizerService, class DebugVisualizerService {
|
|
|
2930
2937
|
this.register = unsupported;
|
|
2931
2938
|
}
|
|
2932
2939
|
}, 1 );
|
|
2940
|
+
registerSingleton(IEditSessionsLogService, class EditSessionsLogService {
|
|
2941
|
+
constructor() {
|
|
2942
|
+
this.onDidChangeLogLevel = Event.None;
|
|
2943
|
+
this.getLevel = unsupported;
|
|
2944
|
+
this.setLevel = unsupported;
|
|
2945
|
+
this.trace = unsupported;
|
|
2946
|
+
this.debug = unsupported;
|
|
2947
|
+
this.info = unsupported;
|
|
2948
|
+
this.warn = unsupported;
|
|
2949
|
+
this.error = unsupported;
|
|
2950
|
+
this.flush = unsupported;
|
|
2951
|
+
this.dispose = unsupported;
|
|
2952
|
+
}
|
|
2953
|
+
}, 1 );
|
|
2954
|
+
registerSingleton(IEditSessionsStorageService, class EditSessionsWorkbenchService {
|
|
2955
|
+
constructor() {
|
|
2956
|
+
this.SIZE_LIMIT = 0;
|
|
2957
|
+
this.isSignedIn = false;
|
|
2958
|
+
this.onDidSignIn = Event.None;
|
|
2959
|
+
this.onDidSignOut = Event.None;
|
|
2960
|
+
this.storeClient = undefined;
|
|
2961
|
+
this.lastReadResources = new Map();
|
|
2962
|
+
this.lastWrittenResources = new Map();
|
|
2963
|
+
this.initialize = unsupported;
|
|
2964
|
+
this.read = unsupported;
|
|
2965
|
+
this.write = unsupported;
|
|
2966
|
+
this.delete = unsupported;
|
|
2967
|
+
this.list = unsupported;
|
|
2968
|
+
this.getMachineById = unsupported;
|
|
2969
|
+
}
|
|
2970
|
+
}, 1 );
|
|
2971
|
+
registerSingleton(IMultiDiffSourceResolverService, class MultiDiffSourceResolverService {
|
|
2972
|
+
constructor() {
|
|
2973
|
+
this.registerResolver = unsupported;
|
|
2974
|
+
this.resolve = unsupported;
|
|
2975
|
+
}
|
|
2976
|
+
}, 1 );
|
|
2977
|
+
registerSingleton(IWorkspaceTagsService, NoOpWorkspaceTagsService, 1 );
|
package/monaco.js
CHANGED
|
@@ -34,6 +34,7 @@ import { ICodeEditorService } from './vscode/src/vs/editor/browser/services/code
|
|
|
34
34
|
import { IKeybindingService } from './vscode/src/vs/platform/keybinding/common/keybinding.js';
|
|
35
35
|
import { Emitter } from './vscode/src/vs/base/common/event.js';
|
|
36
36
|
import { createInjectedClass } from './tools/injection.js';
|
|
37
|
+
import { getService } from './services.js';
|
|
37
38
|
function computeConfiguration(configuration, overrides) {
|
|
38
39
|
const editorConfiguration = isObject(configuration.editor) ? deepClone(configuration.editor) : Object.create(null);
|
|
39
40
|
Object.assign(editorConfiguration, deepClone(overrides));
|
|
@@ -164,16 +165,19 @@ ConfiguredStandaloneDiffEditor = __decorate([
|
|
|
164
165
|
( __param(3, ITextResourceConfigurationService))
|
|
165
166
|
], ConfiguredStandaloneDiffEditor);
|
|
166
167
|
async function writeFile(uri, content) {
|
|
167
|
-
await
|
|
168
|
+
const fileService = await getService(IFileService);
|
|
169
|
+
await fileService.writeFile(uri, VSBuffer.fromString(content));
|
|
168
170
|
}
|
|
169
171
|
async function deleteFile(uri, options) {
|
|
170
|
-
await
|
|
172
|
+
const fileService = await getService(IFileService);
|
|
173
|
+
await fileService.del(uri, options);
|
|
171
174
|
}
|
|
172
175
|
async function createModelReference(resource, content) {
|
|
173
176
|
if (content != null) {
|
|
174
177
|
await writeFile(resource, content);
|
|
175
178
|
}
|
|
176
|
-
|
|
179
|
+
const textModelService = await getService(ITextModelService);
|
|
180
|
+
return (await textModelService.createModelReference(resource));
|
|
177
181
|
}
|
|
178
182
|
function isDynamicKeybindingService(keybindingService) {
|
|
179
183
|
return keybindingService.registerKeybindingProvider != null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-api",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.0-next.1",
|
|
4
4
|
"description": "VSCode public API plugged on the monaco editor",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": {
|
|
@@ -96,12 +96,12 @@
|
|
|
96
96
|
"dependencies": {
|
|
97
97
|
"vscode-marked": "npm:marked@=3.0.2",
|
|
98
98
|
"vscode-semver": "npm:semver@=5.5.0",
|
|
99
|
-
"@codingame/monaco-vscode-
|
|
100
|
-
"@codingame/monaco-vscode-files-service-override": "2.1
|
|
101
|
-
"@codingame/monaco-vscode-
|
|
102
|
-
"@codingame/monaco-vscode-environment-service-override": "2.1
|
|
103
|
-
"@codingame/monaco-vscode-layout-service-override": "2.1
|
|
104
|
-
"@codingame/monaco-vscode-host-service-override": "2.1
|
|
105
|
-
"@codingame/monaco-vscode-base-service-override": "2.1
|
|
99
|
+
"@codingame/monaco-vscode-quickaccess-service-override": "2.2.0-next.1",
|
|
100
|
+
"@codingame/monaco-vscode-files-service-override": "2.2.0-next.1",
|
|
101
|
+
"@codingame/monaco-vscode-extensions-service-override": "2.2.0-next.1",
|
|
102
|
+
"@codingame/monaco-vscode-environment-service-override": "2.2.0-next.1",
|
|
103
|
+
"@codingame/monaco-vscode-layout-service-override": "2.2.0-next.1",
|
|
104
|
+
"@codingame/monaco-vscode-host-service-override": "2.2.0-next.1",
|
|
105
|
+
"@codingame/monaco-vscode-base-service-override": "2.2.0-next.1"
|
|
106
106
|
}
|
|
107
107
|
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { ViewContainerLocation, ViewContainer } from '../../vscode/src/vs/workbench/common/views.js';
|
|
2
|
+
import { BrandedService, ServicesAccessor } from '../../vscode/src/vs/platform/instantiation/common/instantiation.js';
|
|
3
|
+
import { IDisposable } from '../../vscode/src/vs/base/common/lifecycle.js';
|
|
4
|
+
import { Dimension } from '../../vscode/src/vs/base/browser/dom.js';
|
|
5
|
+
import { URI } from '../../vscode/src/vs/base/common/uri.js';
|
|
6
|
+
import { Codicon } from '../../vscode/src/vs/base/common/codicons.js';
|
|
7
|
+
import { RegisteredEditorInfo, RegisteredEditorOptions, EditorInputFactoryObject } from '../../vscode/src/vs/workbench/services/editor/common/editorResolverService.js';
|
|
8
|
+
export { RegisteredEditorPriority } from '../../vscode/src/vs/workbench/services/editor/common/editorResolverService.js';
|
|
9
|
+
import { EditorInput, IEditorCloseHandler } from '../../vscode/src/vs/workbench/common/editor/editorInput.js';
|
|
10
|
+
import { IEditorOpenContext, EditorInputCapabilities, Verbosity, IEditorSerializer } from '../../vscode/src/vs/workbench/common/editor.js';
|
|
11
|
+
import { IEditorOptions } from '../../vscode/src/vs/platform/editor/common/editor.js';
|
|
12
|
+
import { EditorPane } from '../../vscode/src/vs/workbench/browser/parts/editor/editorPane.js';
|
|
13
|
+
import { ITelemetryService } from '../../vscode/src/vs/platform/telemetry/common/telemetry.js';
|
|
14
|
+
import { IStorageService } from '../../vscode/src/vs/platform/storage/common/storage.js';
|
|
15
|
+
import { IThemeService } from '../../vscode/src/vs/platform/theme/common/themeService.js';
|
|
16
|
+
import { CancellationToken } from '../../vscode/src/vs/base/common/cancellation.js';
|
|
17
|
+
import { Event } from '../../vscode/src/vs/base/common/event.js';
|
|
18
|
+
import '../../vscode/src/vs/editor/editor.api.js';
|
|
19
|
+
import { Parts, Position } from '../../vscode/src/vs/workbench/services/layout/browser/layoutService.js';
|
|
20
|
+
|
|
21
|
+
type Label = string | {
|
|
22
|
+
short: string;
|
|
23
|
+
medium: string;
|
|
24
|
+
long: string;
|
|
25
|
+
};
|
|
26
|
+
declare abstract class SimpleEditorPane extends EditorPane {
|
|
27
|
+
protected container: HTMLElement;
|
|
28
|
+
private scrollbar;
|
|
29
|
+
private inputDisposable;
|
|
30
|
+
constructor(id: string, telemetryService: ITelemetryService, themeService: IThemeService, storageService: IStorageService);
|
|
31
|
+
protected createEditor(parent: HTMLElement): void;
|
|
32
|
+
setInput(input: EditorInput, editorOptions: IEditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken): Promise<void>;
|
|
33
|
+
layout(dimension: Dimension): void;
|
|
34
|
+
focus(): void;
|
|
35
|
+
clearInput(): void;
|
|
36
|
+
abstract initialize(): HTMLElement;
|
|
37
|
+
abstract renderInput?(input: EditorInput, options: IEditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken): Promise<IDisposable>;
|
|
38
|
+
}
|
|
39
|
+
declare abstract class SimpleEditorInput extends EditorInput {
|
|
40
|
+
closeHandler?: IEditorCloseHandler | undefined;
|
|
41
|
+
private dirty;
|
|
42
|
+
private _capabilities;
|
|
43
|
+
private name;
|
|
44
|
+
private title;
|
|
45
|
+
private description;
|
|
46
|
+
resource: URI | undefined;
|
|
47
|
+
constructor(resource?: URI, closeHandler?: IEditorCloseHandler | undefined);
|
|
48
|
+
get capabilities(): EditorInputCapabilities;
|
|
49
|
+
addCapability(capability: EditorInputCapabilities): void;
|
|
50
|
+
removeCapability(capability: EditorInputCapabilities): void;
|
|
51
|
+
get editorId(): string | undefined;
|
|
52
|
+
setName(name: string): void;
|
|
53
|
+
setTitle(title: Label): void;
|
|
54
|
+
setDescription(description: string): void;
|
|
55
|
+
private getLabelValue;
|
|
56
|
+
getName(): string;
|
|
57
|
+
getTitle(verbosity?: Verbosity): string;
|
|
58
|
+
getDescription(verbosity?: Verbosity): string;
|
|
59
|
+
isDirty(): boolean;
|
|
60
|
+
setDirty(dirty: boolean): void;
|
|
61
|
+
}
|
|
62
|
+
declare function registerEditorPane<Services extends BrandedService[]>(typeId: string, name: string, ctor: new (...services: Services) => EditorPane, inputCtors: (new (...args: any[]) => EditorInput)[]): IDisposable;
|
|
63
|
+
declare function registerEditor(globPattern: string, editorInfo: RegisteredEditorInfo, editorOptions: RegisteredEditorOptions, factory: EditorInputFactoryObject): IDisposable;
|
|
64
|
+
declare function registerEditorSerializer<Services extends BrandedService[]>(editorTypeId: string, ctor: {
|
|
65
|
+
new (...Services: Services): IEditorSerializer;
|
|
66
|
+
}): IDisposable;
|
|
67
|
+
interface CustomViewOption {
|
|
68
|
+
readonly id: string;
|
|
69
|
+
name: string;
|
|
70
|
+
order?: number;
|
|
71
|
+
renderBody(container: HTMLElement): IDisposable;
|
|
72
|
+
location: ViewContainerLocation;
|
|
73
|
+
icon?: string;
|
|
74
|
+
canMoveView?: boolean;
|
|
75
|
+
default?: boolean;
|
|
76
|
+
actions?: {
|
|
77
|
+
id: string;
|
|
78
|
+
title: string;
|
|
79
|
+
tooltip?: string;
|
|
80
|
+
order?: number;
|
|
81
|
+
run?(accessor: ServicesAccessor): Promise<void>;
|
|
82
|
+
icon?: keyof typeof Codicon;
|
|
83
|
+
render?(container: HTMLElement): void;
|
|
84
|
+
}[];
|
|
85
|
+
viewContainer?: ViewContainer;
|
|
86
|
+
canToggleVisibility?: boolean;
|
|
87
|
+
hideByDefault?: boolean;
|
|
88
|
+
collapsed?: boolean;
|
|
89
|
+
}
|
|
90
|
+
declare function registerCustomView(options: CustomViewOption): IDisposable;
|
|
91
|
+
declare function isPartVisibile(part: Parts): boolean;
|
|
92
|
+
declare function setPartVisibility(part: Exclude<Parts, Parts.STATUSBAR_PART | Parts.TITLEBAR_PART>, visible: boolean): void;
|
|
93
|
+
declare const onDidChangePanelPosition: Event<string>;
|
|
94
|
+
declare function getPanelPosition(): Position;
|
|
95
|
+
declare const onDidChangeSideBarPosition: Event<string>;
|
|
96
|
+
declare function getSideBarPosition(): Position;
|
|
97
|
+
|
|
98
|
+
export { type CustomViewOption, EditorInput, EditorInputCapabilities, EditorInputFactoryObject, EditorPane, IEditorCloseHandler, IEditorSerializer, Parts, RegisteredEditorInfo, RegisteredEditorOptions, SimpleEditorInput, SimpleEditorPane, ViewContainerLocation, getPanelPosition, getSideBarPosition, isPartVisibile, onDidChangePanelPosition, onDidChangeSideBarPosition, registerCustomView, registerEditor, registerEditorPane, registerEditorSerializer, setPartVisibility };
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { SyncDescriptor } from '../../vscode/src/vs/platform/instantiation/common/descriptors.js';
|
|
3
|
+
import { Extensions } from '../../vscode/src/vs/workbench/common/views.js';
|
|
4
|
+
export { ViewContainerLocation } from '../../vscode/src/vs/workbench/common/views.js';
|
|
5
|
+
import { MutableDisposable, DisposableStore } from '../../vscode/src/vs/base/common/lifecycle.js';
|
|
6
|
+
import { size, $, append } from '../../vscode/src/vs/base/browser/dom.js';
|
|
7
|
+
import { ViewPane } from '../../vscode/src/vs/workbench/browser/parts/views/viewPane.js';
|
|
8
|
+
import { Registry } from '../../vscode/src/vs/platform/registry/common/platform.js';
|
|
9
|
+
import { ViewPaneContainer } from '../../vscode/src/vs/workbench/browser/parts/views/viewPaneContainer.js';
|
|
10
|
+
import { URI } from '../../vscode/src/vs/base/common/uri.js';
|
|
11
|
+
import { Codicon } from '../../vscode/src/vs/base/common/codicons.js';
|
|
12
|
+
import { IEditorResolverService } from '../../vscode/src/vs/workbench/services/editor/common/editorResolverService.js';
|
|
13
|
+
export { RegisteredEditorPriority } from '../../vscode/src/vs/workbench/services/editor/common/editorResolverService.js';
|
|
14
|
+
import { EditorInput } from '../../vscode/src/vs/workbench/common/editor/editorInput.js';
|
|
15
|
+
import { EditorExtensions } from '../../vscode/src/vs/workbench/common/editor.js';
|
|
16
|
+
export { EditorInputCapabilities } from '../../vscode/src/vs/workbench/common/editor.js';
|
|
17
|
+
import { registerAction2, Action2, MenuId } from '../../vscode/src/vs/platform/actions/common/actions.js';
|
|
18
|
+
import { Categories } from '../../vscode/src/vs/platform/action/common/actionCommonCategories.js';
|
|
19
|
+
import { ContextKeyExpr } from '../../vscode/src/vs/platform/contextkey/common/contextkey.js';
|
|
20
|
+
import { BaseActionViewItem } from '../../vscode/src/vs/base/browser/ui/actionbar/actionViewItems.js';
|
|
21
|
+
import { EditorPaneDescriptor } from '../../vscode/src/vs/workbench/browser/editor.js';
|
|
22
|
+
import { EditorPane } from '../../vscode/src/vs/workbench/browser/parts/editor/editorPane.js';
|
|
23
|
+
import { ITelemetryService } from '../../vscode/src/vs/platform/telemetry/common/telemetry.js';
|
|
24
|
+
import { IStorageService } from '../../vscode/src/vs/platform/storage/common/storage.js';
|
|
25
|
+
import { IThemeService } from '../../vscode/src/vs/platform/theme/common/themeService.js';
|
|
26
|
+
import { DomScrollableElement } from '../../vscode/src/vs/base/browser/ui/scrollbar/scrollableElement.js';
|
|
27
|
+
import { assertAllDefined, assertIsDefined } from '../../vscode/src/vs/base/common/types.js';
|
|
28
|
+
export { ConfirmResult } from '../../override/vs/platform/dialogs/common/dialogs.js';
|
|
29
|
+
import { IWorkbenchLayoutService } from '../../vscode/src/vs/workbench/services/layout/browser/layoutService.js';
|
|
30
|
+
export { Parts } from '../../vscode/src/vs/workbench/services/layout/browser/layoutService.js';
|
|
31
|
+
import { StandaloneServices } from '../../vscode/src/vs/editor/standalone/browser/standaloneServices.js';
|
|
32
|
+
import { withReadyServices } from '../../services.js';
|
|
33
|
+
let SimpleEditorPane = class SimpleEditorPane extends EditorPane {
|
|
34
|
+
constructor(id, telemetryService, themeService, storageService) {
|
|
35
|
+
super(id, telemetryService, themeService, storageService);
|
|
36
|
+
this.inputDisposable = this._register(new MutableDisposable());
|
|
37
|
+
}
|
|
38
|
+
createEditor(parent) {
|
|
39
|
+
this.container = this.initialize();
|
|
40
|
+
this.scrollbar = this._register(new DomScrollableElement(this.container, { horizontal: 1 , vertical: 1 }));
|
|
41
|
+
parent.appendChild(this.scrollbar.getDomNode());
|
|
42
|
+
}
|
|
43
|
+
async setInput(input, editorOptions, context, token) {
|
|
44
|
+
await super.setInput(input, editorOptions, context, token);
|
|
45
|
+
if (token.isCancellationRequested) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
this.inputDisposable.value = await this.renderInput?.(input, editorOptions, context, token);
|
|
49
|
+
}
|
|
50
|
+
layout(dimension) {
|
|
51
|
+
const [container, scrollbar] = assertAllDefined(this.container, this.scrollbar);
|
|
52
|
+
size(container, dimension.width, dimension.height);
|
|
53
|
+
scrollbar.scanDomNode();
|
|
54
|
+
}
|
|
55
|
+
focus() {
|
|
56
|
+
const container = assertIsDefined(this.container);
|
|
57
|
+
container.focus();
|
|
58
|
+
}
|
|
59
|
+
clearInput() {
|
|
60
|
+
this.inputDisposable.clear();
|
|
61
|
+
super.clearInput();
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
SimpleEditorPane = __decorate([
|
|
65
|
+
( __param(1, ITelemetryService)),
|
|
66
|
+
( __param(2, IThemeService)),
|
|
67
|
+
( __param(3, IStorageService))
|
|
68
|
+
], SimpleEditorPane);
|
|
69
|
+
class SimpleEditorInput extends EditorInput {
|
|
70
|
+
constructor(resource, closeHandler) {
|
|
71
|
+
super();
|
|
72
|
+
this.closeHandler = closeHandler;
|
|
73
|
+
this.dirty = false;
|
|
74
|
+
this._capabilities = 0;
|
|
75
|
+
this.resource = resource;
|
|
76
|
+
}
|
|
77
|
+
get capabilities() {
|
|
78
|
+
return this._capabilities;
|
|
79
|
+
}
|
|
80
|
+
addCapability(capability) {
|
|
81
|
+
this._capabilities |= capability;
|
|
82
|
+
this._onDidChangeCapabilities.fire();
|
|
83
|
+
}
|
|
84
|
+
removeCapability(capability) {
|
|
85
|
+
this._capabilities &= ~capability;
|
|
86
|
+
this._onDidChangeCapabilities.fire();
|
|
87
|
+
}
|
|
88
|
+
get editorId() {
|
|
89
|
+
return this.typeId;
|
|
90
|
+
}
|
|
91
|
+
setName(name) {
|
|
92
|
+
this.name = name;
|
|
93
|
+
this._onDidChangeLabel.fire();
|
|
94
|
+
}
|
|
95
|
+
setTitle(title) {
|
|
96
|
+
this.title = title;
|
|
97
|
+
this._onDidChangeLabel.fire();
|
|
98
|
+
}
|
|
99
|
+
setDescription(description) {
|
|
100
|
+
this.description = description;
|
|
101
|
+
this._onDidChangeLabel.fire();
|
|
102
|
+
}
|
|
103
|
+
getLabelValue(label, verbosity) {
|
|
104
|
+
if (typeof label === 'string') {
|
|
105
|
+
return label;
|
|
106
|
+
}
|
|
107
|
+
switch (verbosity) {
|
|
108
|
+
case 0 :
|
|
109
|
+
return label.short;
|
|
110
|
+
case 2 :
|
|
111
|
+
return label.long;
|
|
112
|
+
case 1 :
|
|
113
|
+
default:
|
|
114
|
+
return label.medium;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
getName() {
|
|
118
|
+
return this.name ?? 'Unnamed';
|
|
119
|
+
}
|
|
120
|
+
getTitle(verbosity) {
|
|
121
|
+
return this.getLabelValue(this.title ?? this.getName(), verbosity);
|
|
122
|
+
}
|
|
123
|
+
getDescription(verbosity) {
|
|
124
|
+
return this.getLabelValue(this.description ?? this.getName(), verbosity);
|
|
125
|
+
}
|
|
126
|
+
isDirty() {
|
|
127
|
+
return this.dirty;
|
|
128
|
+
}
|
|
129
|
+
setDirty(dirty) {
|
|
130
|
+
this.dirty = dirty;
|
|
131
|
+
this._onDidChangeDirty.fire();
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
function registerEditorPane(typeId, name, ctor, inputCtors) {
|
|
135
|
+
return ( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(ctor, typeId, name), ( inputCtors.map(ctor => new SyncDescriptor(ctor))));
|
|
136
|
+
}
|
|
137
|
+
function registerEditor(globPattern, editorInfo, editorOptions, factory) {
|
|
138
|
+
return withReadyServices((servicesAccessor) => {
|
|
139
|
+
const resolverService = servicesAccessor.get(IEditorResolverService);
|
|
140
|
+
return resolverService.registerEditor(globPattern, editorInfo, editorOptions, factory);
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
function registerEditorSerializer(editorTypeId, ctor) {
|
|
144
|
+
return ( Registry.as(EditorExtensions.EditorFactory)).registerEditorSerializer(editorTypeId, ctor);
|
|
145
|
+
}
|
|
146
|
+
function registerCustomView(options) {
|
|
147
|
+
const iconUrl = options.icon != null ? ( URI.parse(options.icon)) : undefined;
|
|
148
|
+
const viewContainer = options.viewContainer ?? ( Registry.as(Extensions.ViewContainersRegistry)).registerViewContainer({
|
|
149
|
+
id: options.id,
|
|
150
|
+
title: { value: options.name, original: options.name },
|
|
151
|
+
order: options.order,
|
|
152
|
+
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [options.id, { mergeViewWithContainerWhenSingleView: true }]),
|
|
153
|
+
hideIfEmpty: true,
|
|
154
|
+
icon: iconUrl
|
|
155
|
+
}, options.location, {
|
|
156
|
+
isDefault: options.default
|
|
157
|
+
});
|
|
158
|
+
const views = [{
|
|
159
|
+
id: options.id,
|
|
160
|
+
name: {
|
|
161
|
+
value: options.name,
|
|
162
|
+
original: options.name
|
|
163
|
+
},
|
|
164
|
+
ctorDescriptor: new SyncDescriptor(class extends ViewPane {
|
|
165
|
+
renderBody(container) {
|
|
166
|
+
super.renderBody(container);
|
|
167
|
+
this.content = $('.view-pane-content');
|
|
168
|
+
this.content.style.display = 'flex';
|
|
169
|
+
this.content.style.alignItems = 'stretch';
|
|
170
|
+
append(container, this.content);
|
|
171
|
+
this._register(options.renderBody(this.content));
|
|
172
|
+
}
|
|
173
|
+
getActionViewItem(action, actionOptions) {
|
|
174
|
+
const customAction = (options.actions ?? []).find(customAction => customAction.id === action.id);
|
|
175
|
+
if (customAction?.render != null) {
|
|
176
|
+
return new (class extends BaseActionViewItem {
|
|
177
|
+
constructor() {
|
|
178
|
+
super(null, action);
|
|
179
|
+
this.render = customAction.render;
|
|
180
|
+
}
|
|
181
|
+
})();
|
|
182
|
+
}
|
|
183
|
+
return super.getActionViewItem(action, actionOptions);
|
|
184
|
+
}
|
|
185
|
+
layoutBody(height, width) {
|
|
186
|
+
this.content.style.height = `${height}px`;
|
|
187
|
+
this.content.style.width = `${width}px`;
|
|
188
|
+
}
|
|
189
|
+
}),
|
|
190
|
+
canMoveView: options.canMoveView ?? true,
|
|
191
|
+
canToggleVisibility: options.canToggleVisibility ?? false,
|
|
192
|
+
hideByDefault: options.hideByDefault ?? false,
|
|
193
|
+
collapsed: options.collapsed ?? false,
|
|
194
|
+
order: options.order,
|
|
195
|
+
containerIcon: iconUrl
|
|
196
|
+
}];
|
|
197
|
+
( Registry.as(Extensions.ViewsRegistry)).registerViews(views, viewContainer);
|
|
198
|
+
const disposableCollection = new DisposableStore();
|
|
199
|
+
disposableCollection.add({
|
|
200
|
+
dispose() {
|
|
201
|
+
( Registry.as(Extensions.ViewsRegistry)).deregisterViews(views, viewContainer);
|
|
202
|
+
if (options.viewContainer == null) {
|
|
203
|
+
( Registry.as(Extensions.ViewContainersRegistry)).deregisterViewContainer(viewContainer);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
for (const action of options.actions ?? []) {
|
|
208
|
+
disposableCollection.add(registerAction2(class extends Action2 {
|
|
209
|
+
constructor() {
|
|
210
|
+
super({
|
|
211
|
+
id: action.id,
|
|
212
|
+
title: { value: action.title, original: action.title },
|
|
213
|
+
category: Categories.View,
|
|
214
|
+
menu: [{
|
|
215
|
+
id: MenuId.ViewTitle,
|
|
216
|
+
when: ( ContextKeyExpr.equals('view', options.id)),
|
|
217
|
+
group: 'navigation',
|
|
218
|
+
order: action.order
|
|
219
|
+
}, {
|
|
220
|
+
id: MenuId.CommandPalette
|
|
221
|
+
}],
|
|
222
|
+
tooltip: action.tooltip,
|
|
223
|
+
icon: action.icon != null ? Codicon[action.icon] : undefined
|
|
224
|
+
});
|
|
225
|
+
this.run = action.run ?? (async () => { });
|
|
226
|
+
}
|
|
227
|
+
}));
|
|
228
|
+
}
|
|
229
|
+
return disposableCollection;
|
|
230
|
+
}
|
|
231
|
+
function isPartVisibile(part) {
|
|
232
|
+
return StandaloneServices.get(IWorkbenchLayoutService).isVisible(part, window);
|
|
233
|
+
}
|
|
234
|
+
function setPartVisibility(part, visible) {
|
|
235
|
+
StandaloneServices.get(IWorkbenchLayoutService).setPartHidden(!visible, part, window);
|
|
236
|
+
}
|
|
237
|
+
const onDidChangePanelPosition = (listener) => {
|
|
238
|
+
return StandaloneServices.get(IWorkbenchLayoutService).onDidChangePanelPosition(listener);
|
|
239
|
+
};
|
|
240
|
+
function getPanelPosition() {
|
|
241
|
+
return StandaloneServices.get(IWorkbenchLayoutService).getPanelPosition();
|
|
242
|
+
}
|
|
243
|
+
const onDidChangeSideBarPosition = (listener) => {
|
|
244
|
+
return StandaloneServices.get(IWorkbenchLayoutService).onDidChangeSideBarPosition(listener);
|
|
245
|
+
};
|
|
246
|
+
function getSideBarPosition() {
|
|
247
|
+
return StandaloneServices.get(IWorkbenchLayoutService).getSideBarPosition();
|
|
248
|
+
}
|
|
249
|
+
export { EditorInput, EditorPane, SimpleEditorInput, SimpleEditorPane, getPanelPosition, getSideBarPosition, isPartVisibile, onDidChangePanelPosition, onDidChangeSideBarPosition, registerCustomView, registerEditor, registerEditorPane, registerEditorSerializer, setPartVisibility };
|