@codingame/monaco-vscode-api 17.1.1 → 17.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lifecycle.js +3 -1
- package/package.json +9 -8
- package/services.d.ts +2 -2
- package/services.js +3 -3
- package/vscode/src/vs/base/browser/dom.js +4 -4
- package/vscode/src/vs/base/browser/markdownRenderer.js +4 -4
- package/vscode/src/vs/base/browser/ui/button/button.js +3 -3
- package/vscode/src/vs/platform/dialogs/common/dialogs.service.d.ts +1 -1
- package/vscode/src/vs/platform/label/common/label.service.d.ts +1 -1
- package/vscode/src/vs/platform/native/common/native.d.ts +1 -1
- package/vscode/src/vs/platform/product/common/product.js +3 -3
- package/vscode/src/vs/platform/userDataSync/common/userDataSync.service.d.ts +1 -1
- package/vscode/src/vs/platform/workspace/common/virtualWorkspace.d.ts +10 -0
- package/vscode/src/vs/platform/workspace/common/virtualWorkspace.js +26 -0
- package/vscode/src/vs/platform/workspaces/common/workspaces.service.d.ts +2 -2
- package/vscode/src/vs/workbench/api/common/extHost.protocol.d.ts +1 -1
- package/vscode/src/vs/workbench/api/common/extHostLabelService.d.ts +1 -1
- package/vscode/src/vs/workbench/browser/contextkeys.d.ts +67 -0
- package/vscode/src/vs/workbench/browser/contextkeys.js +241 -0
- package/vscode/src/vs/workbench/common/editor/editorInput.d.ts +1 -1
- package/vscode/src/vs/workbench/services/layout/browser/layoutService.d.ts +64 -0
- package/vscode/src/vs/workbench/services/layout/browser/layoutService.js +169 -0
- package/vscode/src/vs/workbench/services/layout/browser/layoutService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/services/outline/browser/outline.service.d.ts +1 -1
- package/vscode/src/vs/workbench/services/workspaces/common/workspaceEditing.service.d.ts +1 -1
- package/workers/editor.worker.js +5 -1
- package/vscode/src/vs/base/browser/dompurify/dompurify.js +0 -937
package/lifecycle.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Registry } from './vscode/src/vs/platform/registry/common/platform.js';
|
|
|
3
3
|
import { Extensions } from './vscode/src/vs/workbench/common/contributions.js';
|
|
4
4
|
import { LifecyclePhase } from './vscode/src/vs/workbench/services/lifecycle/common/lifecycle.js';
|
|
5
5
|
import { ILifecycleService } from './vscode/src/vs/workbench/services/lifecycle/common/lifecycle.service.js';
|
|
6
|
-
import './vscode/src/vs/platform/instantiation/common/instantiation.js';
|
|
6
|
+
import { IInstantiationService } from './vscode/src/vs/platform/instantiation/common/instantiation.js';
|
|
7
7
|
import { Barrier, timeout, RunOnceScheduler, _runWhenIdle } from './vscode/src/vs/base/common/async.js';
|
|
8
8
|
import { Emitter } from './vscode/src/vs/base/common/event.js';
|
|
9
9
|
import { EditorExtensions } from './vscode/src/vs/workbench/common/editor.js';
|
|
@@ -14,6 +14,7 @@ import { setHoverDelegateFactory } from './vscode/src/vs/base/browser/ui/hover/h
|
|
|
14
14
|
import { setBaseLayerHoverDelegate } from './vscode/src/vs/base/browser/ui/hover/hoverDelegate2.js';
|
|
15
15
|
import { WorkbenchHoverDelegate } from './vscode/src/vs/platform/hover/browser/hover.js';
|
|
16
16
|
import { IHoverService } from './vscode/src/vs/platform/hover/browser/hover.service.js';
|
|
17
|
+
import { WorkbenchContextKeysHandler } from './vscode/src/vs/workbench/browser/contextkeys.js';
|
|
17
18
|
|
|
18
19
|
const layoutEmitter = new Emitter();
|
|
19
20
|
const onLayout = layoutEmitter.event;
|
|
@@ -55,6 +56,7 @@ async function startup(instantiationService) {
|
|
|
55
56
|
const lifecycleService = accessor.get(ILifecycleService);
|
|
56
57
|
Registry.as(Extensions.Workbench).start(accessor);
|
|
57
58
|
Registry.as(EditorExtensions.EditorFactory).start(accessor);
|
|
59
|
+
accessor.get(IInstantiationService).createInstance(WorkbenchContextKeysHandler);
|
|
58
60
|
layoutEmitter.fire(accessor);
|
|
59
61
|
renderWorkbenchEmitter.fire(accessor);
|
|
60
62
|
await Promise.race([accessor.get(IWorkbenchLayoutService).whenRestored, timeout(2000)]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-api",
|
|
3
|
-
"version": "17.1.
|
|
3
|
+
"version": "17.1.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,14 +15,15 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-base-service-override": "17.1.
|
|
19
|
-
"@codingame/monaco-vscode-environment-service-override": "17.1.
|
|
20
|
-
"@codingame/monaco-vscode-extensions-service-override": "17.1.
|
|
21
|
-
"@codingame/monaco-vscode-files-service-override": "17.1.
|
|
22
|
-
"@codingame/monaco-vscode-host-service-override": "17.1.
|
|
23
|
-
"@codingame/monaco-vscode-layout-service-override": "17.1.
|
|
24
|
-
"@codingame/monaco-vscode-quickaccess-service-override": "17.1.
|
|
18
|
+
"@codingame/monaco-vscode-base-service-override": "17.1.3",
|
|
19
|
+
"@codingame/monaco-vscode-environment-service-override": "17.1.3",
|
|
20
|
+
"@codingame/monaco-vscode-extensions-service-override": "17.1.3",
|
|
21
|
+
"@codingame/monaco-vscode-files-service-override": "17.1.3",
|
|
22
|
+
"@codingame/monaco-vscode-host-service-override": "17.1.3",
|
|
23
|
+
"@codingame/monaco-vscode-layout-service-override": "17.1.3",
|
|
24
|
+
"@codingame/monaco-vscode-quickaccess-service-override": "17.1.3",
|
|
25
25
|
"@vscode/iconv-lite-umd": "0.7.0",
|
|
26
|
+
"dompurify": "3.2.6",
|
|
26
27
|
"jschardet": "3.1.4",
|
|
27
28
|
"marked": "14.0.0"
|
|
28
29
|
},
|
package/services.d.ts
CHANGED
|
@@ -97,8 +97,8 @@ export { ILocaleService } from "./vscode/src/vs/workbench/services/localization/
|
|
|
97
97
|
export { NoOpNotification, NoOpProgress } from "./vscode/src/vs/platform/notification/common/notification.js";
|
|
98
98
|
export { NotificationsFilter, NotificationPriority, NeverShowAgainScope } from "./vscode/src/vs/platform/notification/common/notification.js";
|
|
99
99
|
export type { NotificationMessage, INotificationProperties, INeverShowAgainOptions, INotification, INotificationActions, INotificationProgress, INotificationProgressProperties, INotificationHandle, IPromptChoice, IPromptChoiceWithMenu, IPromptOptions, IStatusMessageOptions } from "./vscode/src/vs/platform/notification/common/notification.js";
|
|
100
|
-
export type { IDialogArgs, DialogType, IDialogResult, IConfirmDialogArgs, IInputDialogArgs, IPromptDialogArgs, IBaseDialogOptions, ICheckbox, ICheckboxResult, IConfirmation, IConfirmationResult, IInput, IInputResult, IInputElement, IPrompt, IPromptResult, IPromptBaseButton, IPromptButton, IPromptCancelButton, IPromptResultWithCancel, IPromptWithCustomCancel, IPromptWithDefaultCancel } from "@codingame/monaco-vscode-
|
|
101
|
-
export type { IDialogHandler, ICustomDialogOptions, ICustomDialogMarkdown } from "@codingame/monaco-vscode-
|
|
100
|
+
export type { IDialogArgs, DialogType, IDialogResult, IConfirmDialogArgs, IInputDialogArgs, IPromptDialogArgs, IBaseDialogOptions, ICheckbox, ICheckboxResult, IConfirmation, IConfirmationResult, IInput, IInputResult, IInputElement, IPrompt, IPromptResult, IPromptBaseButton, IPromptButton, IPromptCancelButton, IPromptResultWithCancel, IPromptWithCustomCancel, IPromptWithDefaultCancel } from "@codingame/monaco-vscode-0f262ee3-cace-5644-818e-eba5fe007685-common/vscode/vs/platform/dialogs/common/dialogs";
|
|
101
|
+
export type { IDialogHandler, ICustomDialogOptions, ICustomDialogMarkdown } from "@codingame/monaco-vscode-0f262ee3-cace-5644-818e-eba5fe007685-common/vscode/vs/platform/dialogs/common/dialogs";
|
|
102
102
|
export type { IMarkdownString, MarkdownStringTrustedOptions } from "./vscode/src/vs/base/common/htmlContent.js";
|
|
103
103
|
export { IActivityService } from "./vscode/src/vs/workbench/services/activity/common/activity.service.js";
|
|
104
104
|
export type { IBadge } from "@codingame/monaco-vscode-a7c9ae3c-16d2-5d17-86b2-981be7094566-common/vscode/vs/workbench/services/activity/common/activity";
|
package/services.js
CHANGED
|
@@ -182,10 +182,10 @@ export { IKeybindingService } from './vscode/src/vs/platform/keybinding/common/k
|
|
|
182
182
|
export { ISecretStorageService } from './vscode/src/vs/platform/secrets/common/secrets.service.js';
|
|
183
183
|
export { ConfigurationTarget } from './vscode/src/vs/platform/configuration/common/configuration.js';
|
|
184
184
|
|
|
185
|
-
if (window.monacoVscodeApiBuildId != null && window.monacoVscodeApiBuildId !== "1.100.
|
|
186
|
-
throw new Error(`Another version of monaco-vscode-api has already been loaded. Trying to load ${"1.100.
|
|
185
|
+
if (window.monacoVscodeApiBuildId != null && window.monacoVscodeApiBuildId !== "1.100.3-02a8a23b-6340-4b94-ae7b-d6a8042935e8") {
|
|
186
|
+
throw new Error(`Another version of monaco-vscode-api has already been loaded. Trying to load ${"1.100.3-02a8a23b-6340-4b94-ae7b-d6a8042935e8"}, ${window.monacoVscodeApiBuildId} is already loaded`);
|
|
187
187
|
}
|
|
188
|
-
window.monacoVscodeApiBuildId = "1.100.
|
|
188
|
+
window.monacoVscodeApiBuildId = "1.100.3-02a8a23b-6340-4b94-ae7b-d6a8042935e8";
|
|
189
189
|
async function initialize(overrides, container = document.body, configuration = {}, env) {
|
|
190
190
|
checkServicesNotInitialized();
|
|
191
191
|
injectCss(container);
|
|
@@ -6,7 +6,7 @@ import { StandardMouseEvent } from './mouseEvent.js';
|
|
|
6
6
|
import { _runWhenIdle, AbstractIdleValue, IntervalTimer, TimeoutTimer } from '../common/async.js';
|
|
7
7
|
import { onUnexpectedError } from '../common/errors.js';
|
|
8
8
|
import { Emitter, Event } from '../common/event.js';
|
|
9
|
-
import
|
|
9
|
+
import dompurify from 'dompurify';
|
|
10
10
|
import { KeyCode } from '../common/keyCodes.js';
|
|
11
11
|
import { DisposableStore, Disposable, toDisposable } from '../common/lifecycle.js';
|
|
12
12
|
import { RemoteAuthorities, Schemas } from '../common/network.js';
|
|
@@ -1013,7 +1013,7 @@ function detectFullscreen(targetWindow) {
|
|
|
1013
1013
|
}
|
|
1014
1014
|
function hookDomPurifyHrefAndSrcSanitizer(allowedProtocols, allowDataImages = false) {
|
|
1015
1015
|
const anchor = document.createElement('a');
|
|
1016
|
-
|
|
1016
|
+
dompurify.addHook('afterSanitizeAttributes', (node) => {
|
|
1017
1017
|
for (const attr of ['href', 'src']) {
|
|
1018
1018
|
if (node.hasAttribute(attr)) {
|
|
1019
1019
|
const attrValue = node.getAttribute(attr);
|
|
@@ -1031,7 +1031,7 @@ function hookDomPurifyHrefAndSrcSanitizer(allowedProtocols, allowDataImages = fa
|
|
|
1031
1031
|
}
|
|
1032
1032
|
});
|
|
1033
1033
|
return toDisposable(() => {
|
|
1034
|
-
|
|
1034
|
+
dompurify.removeHook('afterSanitizeAttributes');
|
|
1035
1035
|
});
|
|
1036
1036
|
}
|
|
1037
1037
|
const defaultSafeProtocols = [
|
|
@@ -1118,7 +1118,7 @@ const defaultDomPurifyConfig = ( Object.freeze({
|
|
|
1118
1118
|
function safeInnerHtml(node, value, extraDomPurifyConfig) {
|
|
1119
1119
|
const hook = hookDomPurifyHrefAndSrcSanitizer(defaultSafeProtocols);
|
|
1120
1120
|
try {
|
|
1121
|
-
const html =
|
|
1121
|
+
const html = dompurify.sanitize(value, { ...defaultDomPurifyConfig, ...extraDomPurifyConfig });
|
|
1122
1122
|
node.innerHTML = html;
|
|
1123
1123
|
}
|
|
1124
1124
|
finally {
|
|
@@ -15,7 +15,7 @@ import { resolvePath, dirname } from '../common/resources.js';
|
|
|
15
15
|
import { escape } from '../common/strings.js';
|
|
16
16
|
import { URI } from '../common/uri.js';
|
|
17
17
|
import { reset, addDisposableListener, getWindow, $, isHTMLElement, hookDomPurifyHrefAndSrcSanitizer, basicMarkupHtmlTags } from './dom.js';
|
|
18
|
-
import
|
|
18
|
+
import dompurify from 'dompurify';
|
|
19
19
|
import { DomEmitter } from './event.js';
|
|
20
20
|
import { createElement } from './formattedTextRenderer.js';
|
|
21
21
|
import { StandardKeyboardEvent } from './keyboardEvent.js';
|
|
@@ -394,7 +394,7 @@ function sanitizeRenderedMarkdown(options, renderedMarkdown) {
|
|
|
394
394
|
}));
|
|
395
395
|
store.add(hookDomPurifyHrefAndSrcSanitizer(allowedSchemes));
|
|
396
396
|
try {
|
|
397
|
-
return
|
|
397
|
+
return dompurify.sanitize(renderedMarkdown, { ...config, RETURN_TRUSTED_TYPE: true });
|
|
398
398
|
}
|
|
399
399
|
finally {
|
|
400
400
|
store.dispose();
|
|
@@ -741,8 +741,8 @@ function completeTable(tokens) {
|
|
|
741
741
|
return undefined;
|
|
742
742
|
}
|
|
743
743
|
function addDompurifyHook(hook, cb) {
|
|
744
|
-
|
|
745
|
-
return toDisposable(() =>
|
|
744
|
+
dompurify.addHook(hook, cb);
|
|
745
|
+
return toDisposable(() => dompurify.removeHook(hook));
|
|
746
746
|
}
|
|
747
747
|
|
|
748
748
|
export { allowedMarkdownAttr, fillInIncompleteTokens, renderMarkdown, renderMarkdownAsPlaintext, renderStringAsPlaintext };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { registerCss } from '@codingame/monaco-vscode-api/css';
|
|
3
3
|
import { EventType, addDisposableListener, EventHelper, trackFocus, reset, isActiveElement, $ } from '../../dom.js';
|
|
4
|
-
import
|
|
4
|
+
import dompurify from 'dompurify';
|
|
5
5
|
import { StandardKeyboardEvent } from '../../keyboardEvent.js';
|
|
6
6
|
import { renderMarkdown, renderStringAsPlaintext } from '../../markdownRenderer.js';
|
|
7
7
|
import { Gesture, EventType as EventType$1 } from '../../touch.js';
|
|
@@ -157,7 +157,7 @@ class Button extends Disposable {
|
|
|
157
157
|
rendered.dispose();
|
|
158
158
|
const root = rendered.element.querySelector('p')?.innerHTML;
|
|
159
159
|
if (root) {
|
|
160
|
-
const sanitized =
|
|
160
|
+
const sanitized = dompurify.sanitize(root, { ADD_TAGS: ['b', 'i', 'u', 'code', 'span'], ALLOWED_ATTR: ['class'], RETURN_TRUSTED_TYPE: true });
|
|
161
161
|
labelElement.innerHTML = sanitized;
|
|
162
162
|
}
|
|
163
163
|
else {
|
|
@@ -466,7 +466,7 @@ class ButtonWithIcon extends Button {
|
|
|
466
466
|
rendered.dispose();
|
|
467
467
|
const root = rendered.element.querySelector('p')?.innerHTML;
|
|
468
468
|
if (root) {
|
|
469
|
-
const sanitized =
|
|
469
|
+
const sanitized = dompurify.sanitize(root, { ADD_TAGS: ['b', 'i', 'u', 'code', 'span'], ALLOWED_ATTR: ['class'], RETURN_TRUSTED_TYPE: true });
|
|
470
470
|
this._mdlabelElement.innerHTML = sanitized;
|
|
471
471
|
}
|
|
472
472
|
else {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Event } from "../../../base/common/event.js";
|
|
2
2
|
import { URI } from "../../../base/common/uri.js";
|
|
3
|
-
import { IConfirmation, IConfirmationResult, IPromptWithCustomCancel, IPromptResultWithCancel, IPromptWithDefaultCancel, IPromptResult, IPrompt, IInput, IInputResult, type ConfirmResult, type IOpenDialogOptions, type IPickAndOpenOptions, type ISaveDialogOptions } from "@codingame/monaco-vscode-
|
|
3
|
+
import { IConfirmation, IConfirmationResult, IPromptWithCustomCancel, IPromptResultWithCancel, IPromptWithDefaultCancel, IPromptResult, IPrompt, IInput, IInputResult, type ConfirmResult, type IOpenDialogOptions, type IPickAndOpenOptions, type ISaveDialogOptions } from "@codingame/monaco-vscode-0f262ee3-cace-5644-818e-eba5fe007685-common/vscode/vs/platform/dialogs/common/dialogs";
|
|
4
4
|
export declare const IDialogService: import("../../instantiation/common/instantiation.js").ServiceIdentifier<IDialogService>;
|
|
5
5
|
export interface IDialogService {
|
|
6
6
|
readonly _serviceBrand: undefined;
|
|
@@ -2,7 +2,7 @@ import { Event } from "../../../base/common/event.js";
|
|
|
2
2
|
import { IDisposable } from "../../../base/common/lifecycle.js";
|
|
3
3
|
import { URI } from "../../../base/common/uri.js";
|
|
4
4
|
import { IWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, IWorkspace } from "../../workspace/common/workspace.js";
|
|
5
|
-
import { Verbosity, ResourceLabelFormatter, IFormatterChangeEvent } from "@codingame/monaco-vscode-
|
|
5
|
+
import { Verbosity, ResourceLabelFormatter, IFormatterChangeEvent } from "@codingame/monaco-vscode-158b9837-fc78-5d9c-86f5-9134e4358643-common/vscode/vs/platform/label/common/label";
|
|
6
6
|
export declare const ILabelService: import("../../instantiation/common/instantiation.js").ServiceIdentifier<ILabelService>;
|
|
7
7
|
export interface ILabelService {
|
|
8
8
|
readonly _serviceBrand: undefined;
|
|
@@ -4,7 +4,7 @@ import { Event } from "../../../base/common/event.js";
|
|
|
4
4
|
import { URI } from "../../../base/common/uri.js";
|
|
5
5
|
import { MessageBoxOptions, MessageBoxReturnValue, OpenDevToolsOptions, OpenDialogOptions, OpenDialogReturnValue, SaveDialogOptions, SaveDialogReturnValue } from "../../../base/parts/sandbox/common/electronTypes.js";
|
|
6
6
|
import { ISerializableCommandAction } from "../../action/common/action.js";
|
|
7
|
-
import { INativeOpenDialogOptions } from "@codingame/monaco-vscode-
|
|
7
|
+
import { INativeOpenDialogOptions } from "@codingame/monaco-vscode-0f262ee3-cace-5644-818e-eba5fe007685-common/vscode/vs/platform/dialogs/common/dialogs";
|
|
8
8
|
import { IV8Profile } from "../../profiling/common/profiling.js";
|
|
9
9
|
import { AuthInfo, Credentials } from "../../request/common/request.js";
|
|
10
10
|
import { IPartsSplash } from "../../theme/common/themeService.js";
|
|
@@ -4,9 +4,9 @@ import productJson from '../../../../../product.json.js';
|
|
|
4
4
|
var product = {
|
|
5
5
|
...productJson,
|
|
6
6
|
quality: 'stable',
|
|
7
|
-
version: '1.100.
|
|
8
|
-
commit: '
|
|
9
|
-
date: '2025-
|
|
7
|
+
version: '1.100.3',
|
|
8
|
+
commit: '258e40fedc6cb8edf399a463ce3a9d32e7e1f6f3',
|
|
9
|
+
date: '2025-06-04T12:35:19.633Z',
|
|
10
10
|
...(globalThis._VSCODE_PRODUCT_JSON ?? {})
|
|
11
11
|
};
|
|
12
12
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VSBufferReadableStream } from "../../../base/common/buffer.js";
|
|
2
2
|
import { IStringDictionary } from "../../../base/common/collections.js";
|
|
3
3
|
import { Event } from "../../../base/common/event.js";
|
|
4
|
-
import { FormattingOptions } from "@codingame/monaco-vscode-
|
|
4
|
+
import { FormattingOptions } from "@codingame/monaco-vscode-158b9837-fc78-5d9c-86f5-9134e4358643-common/vscode/vs/base/common/jsonFormatter";
|
|
5
5
|
import { URI } from "../../../base/common/uri.js";
|
|
6
6
|
import { IHeaders } from "@codingame/monaco-vscode-912ff6c1-e6aa-58cf-bd7f-50cf27bdb591-common/vscode/vs/base/parts/request/common/request";
|
|
7
7
|
import { ILogService } from "../../log/common/log.service.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { URI } from "../../../base/common/uri.js";
|
|
2
|
+
import { IWorkspace } from "./workspace.js";
|
|
3
|
+
export declare function isVirtualResource(resource: URI): boolean;
|
|
4
|
+
export declare function getVirtualWorkspaceLocation(workspace: IWorkspace): {
|
|
5
|
+
scheme: string;
|
|
6
|
+
authority: string;
|
|
7
|
+
} | undefined;
|
|
8
|
+
export declare function getVirtualWorkspaceScheme(workspace: IWorkspace): string | undefined;
|
|
9
|
+
export declare function getVirtualWorkspaceAuthority(workspace: IWorkspace): string | undefined;
|
|
10
|
+
export declare function isVirtualWorkspace(workspace: IWorkspace): boolean;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
import { Schemas } from '../../../base/common/network.js';
|
|
3
|
+
|
|
4
|
+
function isVirtualResource(resource) {
|
|
5
|
+
return resource.scheme !== Schemas.file && resource.scheme !== Schemas.vscodeRemote;
|
|
6
|
+
}
|
|
7
|
+
function getVirtualWorkspaceLocation(workspace) {
|
|
8
|
+
if (workspace.folders.length) {
|
|
9
|
+
return workspace.folders.every(f => isVirtualResource(f.uri)) ? workspace.folders[0].uri : undefined;
|
|
10
|
+
}
|
|
11
|
+
else if (workspace.configuration && isVirtualResource(workspace.configuration)) {
|
|
12
|
+
return workspace.configuration;
|
|
13
|
+
}
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
function getVirtualWorkspaceScheme(workspace) {
|
|
17
|
+
return getVirtualWorkspaceLocation(workspace)?.scheme;
|
|
18
|
+
}
|
|
19
|
+
function getVirtualWorkspaceAuthority(workspace) {
|
|
20
|
+
return getVirtualWorkspaceLocation(workspace)?.authority;
|
|
21
|
+
}
|
|
22
|
+
function isVirtualWorkspace(workspace) {
|
|
23
|
+
return getVirtualWorkspaceLocation(workspace) !== undefined;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { getVirtualWorkspaceAuthority, getVirtualWorkspaceLocation, getVirtualWorkspaceScheme, isVirtualResource, isVirtualWorkspace };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Event } from "../../../base/common/event.js";
|
|
2
2
|
import { URI } from "../../../base/common/uri.js";
|
|
3
|
-
import { IWorkspaceBackupInfo, IFolderBackupInfo } from "@codingame/monaco-vscode-
|
|
3
|
+
import { IWorkspaceBackupInfo, IFolderBackupInfo } from "@codingame/monaco-vscode-158b9837-fc78-5d9c-86f5-9134e4358643-common/vscode/vs/platform/backup/common/backup";
|
|
4
4
|
import { IWorkspaceIdentifier } from "../../workspace/common/workspace.js";
|
|
5
|
-
import { IEnterWorkspaceResult, IWorkspaceFolderCreationData, IRecent, IRecentlyOpened } from "@codingame/monaco-vscode-
|
|
5
|
+
import { IEnterWorkspaceResult, IWorkspaceFolderCreationData, IRecent, IRecentlyOpened } from "@codingame/monaco-vscode-158b9837-fc78-5d9c-86f5-9134e4358643-common/vscode/vs/platform/workspaces/common/workspaces";
|
|
6
6
|
export declare const IWorkspacesService: import("../../instantiation/common/instantiation.js").ServiceIdentifier<IWorkspacesService>;
|
|
7
7
|
export interface IWorkspacesService {
|
|
8
8
|
readonly _serviceBrand: undefined;
|
|
@@ -29,7 +29,7 @@ import { ConfigurationScope } from "../../../platform/configuration/common/confi
|
|
|
29
29
|
import { IExtensionIdWithVersion } from "@codingame/monaco-vscode-a2719803-af40-5ae9-a29f-8a2231c33056-common/vscode/vs/platform/extensionManagement/common/extensionStorage";
|
|
30
30
|
import { ExtensionIdentifier, IExtensionDescription } from "../../../platform/extensions/common/extensions.js";
|
|
31
31
|
import * as files from "../../../platform/files/common/files.js";
|
|
32
|
-
import { ResourceLabelFormatter } from "@codingame/monaco-vscode-
|
|
32
|
+
import { ResourceLabelFormatter } from "@codingame/monaco-vscode-158b9837-fc78-5d9c-86f5-9134e4358643-common/vscode/vs/platform/label/common/label";
|
|
33
33
|
import { ILoggerOptions, ILoggerResource, LogLevel } from "../../../platform/log/common/log.js";
|
|
34
34
|
import { IMarkerData } from "../../../platform/markers/common/markers.js";
|
|
35
35
|
import { IProgressOptions, IProgressStep } from "../../../platform/progress/common/progress.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ResourceLabelFormatter } from "@codingame/monaco-vscode-
|
|
1
|
+
import { ResourceLabelFormatter } from "@codingame/monaco-vscode-158b9837-fc78-5d9c-86f5-9134e4358643-common/vscode/vs/platform/label/common/label";
|
|
2
2
|
import { IDisposable } from "../../../base/common/lifecycle.js";
|
|
3
3
|
import { ExtHostLabelServiceShape, IMainContext } from "./extHost.protocol.js";
|
|
4
4
|
export declare class ExtHostLabelService implements ExtHostLabelServiceShape {
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Disposable } from "../../base/common/lifecycle.js";
|
|
2
|
+
import { IContextKeyService } from "../../platform/contextkey/common/contextkey.service.js";
|
|
3
|
+
import { IEditorGroupsService } from "../services/editor/common/editorGroupsService.service.js";
|
|
4
|
+
import { IConfigurationService } from "../../platform/configuration/common/configuration.service.js";
|
|
5
|
+
import { IWorkbenchEnvironmentService } from "../services/environment/common/environmentService.service.js";
|
|
6
|
+
import { IWorkspaceContextService } from "../../platform/workspace/common/workspace.service.js";
|
|
7
|
+
import { IWorkbenchLayoutService } from "../services/layout/browser/layoutService.service.js";
|
|
8
|
+
import { IWorkingCopyService } from "../services/workingCopy/common/workingCopyService.service.js";
|
|
9
|
+
import { IPaneCompositePartService } from "../services/panecomposite/browser/panecomposite.service.js";
|
|
10
|
+
import { IProductService } from "../../platform/product/common/productService.service.js";
|
|
11
|
+
import { IEditorService } from "../services/editor/common/editorService.service.js";
|
|
12
|
+
export declare class WorkbenchContextKeysHandler extends Disposable {
|
|
13
|
+
private readonly contextKeyService;
|
|
14
|
+
private readonly contextService;
|
|
15
|
+
private readonly configurationService;
|
|
16
|
+
private readonly environmentService;
|
|
17
|
+
private readonly productService;
|
|
18
|
+
private readonly editorGroupService;
|
|
19
|
+
private readonly editorService;
|
|
20
|
+
private readonly layoutService;
|
|
21
|
+
private readonly paneCompositeService;
|
|
22
|
+
private readonly workingCopyService;
|
|
23
|
+
private inputFocusedContext;
|
|
24
|
+
private dirtyWorkingCopiesContext;
|
|
25
|
+
private activeEditorGroupEmpty;
|
|
26
|
+
private activeEditorGroupIndex;
|
|
27
|
+
private activeEditorGroupLast;
|
|
28
|
+
private activeEditorGroupLocked;
|
|
29
|
+
private multipleEditorGroupsContext;
|
|
30
|
+
private editorsVisibleContext;
|
|
31
|
+
private splitEditorsVerticallyContext;
|
|
32
|
+
private workbenchStateContext;
|
|
33
|
+
private workspaceFolderCountContext;
|
|
34
|
+
private openFolderWorkspaceSupportContext;
|
|
35
|
+
private enterMultiRootWorkspaceSupportContext;
|
|
36
|
+
private emptyWorkspaceSupportContext;
|
|
37
|
+
private virtualWorkspaceContext;
|
|
38
|
+
private temporaryWorkspaceContext;
|
|
39
|
+
private inZenModeContext;
|
|
40
|
+
private isMainWindowFullscreenContext;
|
|
41
|
+
private isAuxiliaryWindowFocusedContext;
|
|
42
|
+
private isMainEditorCenteredLayoutContext;
|
|
43
|
+
private sideBarVisibleContext;
|
|
44
|
+
private mainEditorAreaVisibleContext;
|
|
45
|
+
private panelPositionContext;
|
|
46
|
+
private panelVisibleContext;
|
|
47
|
+
private panelAlignmentContext;
|
|
48
|
+
private panelMaximizedContext;
|
|
49
|
+
private auxiliaryBarVisibleContext;
|
|
50
|
+
private editorTabsVisibleContext;
|
|
51
|
+
private titleAreaVisibleContext;
|
|
52
|
+
private titleBarStyleContext;
|
|
53
|
+
constructor(contextKeyService: IContextKeyService, contextService: IWorkspaceContextService, configurationService: IConfigurationService, environmentService: IWorkbenchEnvironmentService, productService: IProductService, editorGroupService: IEditorGroupsService, editorService: IEditorService, layoutService: IWorkbenchLayoutService, paneCompositeService: IPaneCompositePartService, workingCopyService: IWorkingCopyService);
|
|
54
|
+
private registerListeners;
|
|
55
|
+
private updateVisiblePanesContextKeys;
|
|
56
|
+
private updateActiveEditorGroupContextKeys;
|
|
57
|
+
private updateEditorGroupsContextKeys;
|
|
58
|
+
private updateEditorAreaContextKeys;
|
|
59
|
+
private updateInputContextKeys;
|
|
60
|
+
private updateWorkbenchStateContextKey;
|
|
61
|
+
private updateWorkspaceFolderCountContextKey;
|
|
62
|
+
private updateSplitEditorsVerticallyContext;
|
|
63
|
+
private getWorkbenchStateString;
|
|
64
|
+
private updateSideBarContextKeys;
|
|
65
|
+
private updateTitleBarContextKeys;
|
|
66
|
+
private updateWorkspaceContextKeys;
|
|
67
|
+
}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '../../../../../external/tslib/tslib.es6.js';
|
|
3
|
+
import { Event } from '../../base/common/event.js';
|
|
4
|
+
import { Disposable } from '../../base/common/lifecycle.js';
|
|
5
|
+
import { setConstant } from '../../platform/contextkey/common/contextkey.js';
|
|
6
|
+
import { IContextKeyService } from '../../platform/contextkey/common/contextkey.service.js';
|
|
7
|
+
import { IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsIOSContext, IsMobileContext, IsDevelopmentContext, ProductQualityContext, InputFocusedContext } from '../../platform/contextkey/common/contextkeys.js';
|
|
8
|
+
import { RemoteNameContext, VirtualWorkspaceContext, TemporaryWorkspaceContext, HasWebFileSystemAccess, EmbedderIdentifierContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, DirtyWorkingCopiesContext, WorkbenchStateContext, WorkspaceFolderCountContext, OpenFolderWorkspaceSupportContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, SplitEditorsVertically, IsMainWindowFullscreenContext, IsAuxiliaryWindowFocusedContext, InEditorZenModeContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, EditorTabsVisibleContext, SideBarVisibleContext, TitleBarVisibleContext, TitleBarStyleContext, PanelPositionContext, PanelVisibleContext, PanelMaximizedContext, PanelAlignmentContext, AuxiliaryBarVisibleContext } from '../common/contextkeys.js';
|
|
9
|
+
import { onDidRegisterWindow, addDisposableListener, EventType, isEditableElement, trackFocus, getActiveWindow } from '../../base/browser/dom.js';
|
|
10
|
+
import { preferredSideBySideGroupDirection, GroupDirection } from '../services/editor/common/editorGroupsService.js';
|
|
11
|
+
import { IEditorGroupsService } from '../services/editor/common/editorGroupsService.service.js';
|
|
12
|
+
import { IConfigurationService } from '../../platform/configuration/common/configuration.service.js';
|
|
13
|
+
import { IWorkbenchEnvironmentService } from '../services/environment/common/environmentService.service.js';
|
|
14
|
+
import { WorkbenchState, isTemporaryWorkspace } from '../../platform/workspace/common/workspace.js';
|
|
15
|
+
import { IWorkspaceContextService } from '../../platform/workspace/common/workspace.service.js';
|
|
16
|
+
import { positionToString, Parts } from '../services/layout/browser/layoutService.js';
|
|
17
|
+
import { IWorkbenchLayoutService } from '../services/layout/browser/layoutService.service.js';
|
|
18
|
+
import { getRemoteName } from '../../platform/remote/common/remoteHosts.js';
|
|
19
|
+
import { getVirtualWorkspaceScheme } from '../../platform/workspace/common/virtualWorkspace.js';
|
|
20
|
+
import { IWorkingCopyService } from '../services/workingCopy/common/workingCopyService.service.js';
|
|
21
|
+
import { isNative } from '../../base/common/platform.js';
|
|
22
|
+
import { IPaneCompositePartService } from '../services/panecomposite/browser/panecomposite.service.js';
|
|
23
|
+
import { WebFileSystemAccess } from '../../platform/files/browser/webFileSystemAccess.js';
|
|
24
|
+
import { IProductService } from '../../platform/product/common/productService.service.js';
|
|
25
|
+
import { getTitleBarStyle } from '../../platform/window/common/window.js';
|
|
26
|
+
import { mainWindow } from '../../base/browser/window.js';
|
|
27
|
+
import { onDidChangeFullscreen, isFullscreen } from '../../base/browser/browser.js';
|
|
28
|
+
import { IEditorService } from '../services/editor/common/editorService.service.js';
|
|
29
|
+
|
|
30
|
+
let WorkbenchContextKeysHandler = class WorkbenchContextKeysHandler extends Disposable {
|
|
31
|
+
constructor(contextKeyService, contextService, configurationService, environmentService, productService, editorGroupService, editorService, layoutService, paneCompositeService, workingCopyService) {
|
|
32
|
+
super();
|
|
33
|
+
this.contextKeyService = contextKeyService;
|
|
34
|
+
this.contextService = contextService;
|
|
35
|
+
this.configurationService = configurationService;
|
|
36
|
+
this.environmentService = environmentService;
|
|
37
|
+
this.productService = productService;
|
|
38
|
+
this.editorGroupService = editorGroupService;
|
|
39
|
+
this.editorService = editorService;
|
|
40
|
+
this.layoutService = layoutService;
|
|
41
|
+
this.paneCompositeService = paneCompositeService;
|
|
42
|
+
this.workingCopyService = workingCopyService;
|
|
43
|
+
IsMacContext.bindTo(this.contextKeyService);
|
|
44
|
+
IsLinuxContext.bindTo(this.contextKeyService);
|
|
45
|
+
IsWindowsContext.bindTo(this.contextKeyService);
|
|
46
|
+
IsWebContext.bindTo(this.contextKeyService);
|
|
47
|
+
IsMacNativeContext.bindTo(this.contextKeyService);
|
|
48
|
+
IsIOSContext.bindTo(this.contextKeyService);
|
|
49
|
+
IsMobileContext.bindTo(this.contextKeyService);
|
|
50
|
+
RemoteNameContext.bindTo(this.contextKeyService).set(getRemoteName(this.environmentService.remoteAuthority) || '');
|
|
51
|
+
this.virtualWorkspaceContext = VirtualWorkspaceContext.bindTo(this.contextKeyService);
|
|
52
|
+
this.temporaryWorkspaceContext = TemporaryWorkspaceContext.bindTo(this.contextKeyService);
|
|
53
|
+
this.updateWorkspaceContextKeys();
|
|
54
|
+
HasWebFileSystemAccess.bindTo(this.contextKeyService).set(WebFileSystemAccess.supported(mainWindow));
|
|
55
|
+
const isDevelopment = !this.environmentService.isBuilt || this.environmentService.isExtensionDevelopment;
|
|
56
|
+
IsDevelopmentContext.bindTo(this.contextKeyService).set(isDevelopment);
|
|
57
|
+
setConstant(IsDevelopmentContext.key, isDevelopment);
|
|
58
|
+
ProductQualityContext.bindTo(this.contextKeyService).set(this.productService.quality || '');
|
|
59
|
+
EmbedderIdentifierContext.bindTo(this.contextKeyService).set(productService.embedderIdentifier);
|
|
60
|
+
this.activeEditorGroupEmpty = ActiveEditorGroupEmptyContext.bindTo(this.contextKeyService);
|
|
61
|
+
this.activeEditorGroupIndex = ActiveEditorGroupIndexContext.bindTo(this.contextKeyService);
|
|
62
|
+
this.activeEditorGroupLast = ActiveEditorGroupLastContext.bindTo(this.contextKeyService);
|
|
63
|
+
this.activeEditorGroupLocked = ActiveEditorGroupLockedContext.bindTo(this.contextKeyService);
|
|
64
|
+
this.multipleEditorGroupsContext = MultipleEditorGroupsContext.bindTo(this.contextKeyService);
|
|
65
|
+
this.editorsVisibleContext = EditorsVisibleContext.bindTo(this.contextKeyService);
|
|
66
|
+
this.dirtyWorkingCopiesContext = DirtyWorkingCopiesContext.bindTo(this.contextKeyService);
|
|
67
|
+
this.dirtyWorkingCopiesContext.set(this.workingCopyService.hasDirty);
|
|
68
|
+
this.inputFocusedContext = InputFocusedContext.bindTo(this.contextKeyService);
|
|
69
|
+
this.workbenchStateContext = WorkbenchStateContext.bindTo(this.contextKeyService);
|
|
70
|
+
this.updateWorkbenchStateContextKey();
|
|
71
|
+
this.workspaceFolderCountContext = WorkspaceFolderCountContext.bindTo(this.contextKeyService);
|
|
72
|
+
this.updateWorkspaceFolderCountContextKey();
|
|
73
|
+
this.openFolderWorkspaceSupportContext = OpenFolderWorkspaceSupportContext.bindTo(this.contextKeyService);
|
|
74
|
+
this.openFolderWorkspaceSupportContext.set(isNative || typeof this.environmentService.remoteAuthority === 'string');
|
|
75
|
+
this.emptyWorkspaceSupportContext = EmptyWorkspaceSupportContext.bindTo(this.contextKeyService);
|
|
76
|
+
this.emptyWorkspaceSupportContext.set(isNative || typeof this.environmentService.remoteAuthority === 'string');
|
|
77
|
+
this.enterMultiRootWorkspaceSupportContext = EnterMultiRootWorkspaceSupportContext.bindTo(this.contextKeyService);
|
|
78
|
+
this.enterMultiRootWorkspaceSupportContext.set(isNative || typeof this.environmentService.remoteAuthority === 'string');
|
|
79
|
+
this.splitEditorsVerticallyContext = SplitEditorsVertically.bindTo(this.contextKeyService);
|
|
80
|
+
this.updateSplitEditorsVerticallyContext();
|
|
81
|
+
this.isMainWindowFullscreenContext = IsMainWindowFullscreenContext.bindTo(this.contextKeyService);
|
|
82
|
+
this.isAuxiliaryWindowFocusedContext = IsAuxiliaryWindowFocusedContext.bindTo(this.contextKeyService);
|
|
83
|
+
this.inZenModeContext = InEditorZenModeContext.bindTo(this.contextKeyService);
|
|
84
|
+
this.isMainEditorCenteredLayoutContext = IsMainEditorCenteredLayoutContext.bindTo(this.contextKeyService);
|
|
85
|
+
this.mainEditorAreaVisibleContext = MainEditorAreaVisibleContext.bindTo(this.contextKeyService);
|
|
86
|
+
this.editorTabsVisibleContext = EditorTabsVisibleContext.bindTo(this.contextKeyService);
|
|
87
|
+
this.sideBarVisibleContext = SideBarVisibleContext.bindTo(this.contextKeyService);
|
|
88
|
+
this.titleAreaVisibleContext = TitleBarVisibleContext.bindTo(this.contextKeyService);
|
|
89
|
+
this.titleBarStyleContext = TitleBarStyleContext.bindTo(this.contextKeyService);
|
|
90
|
+
this.updateTitleBarContextKeys();
|
|
91
|
+
this.panelPositionContext = PanelPositionContext.bindTo(this.contextKeyService);
|
|
92
|
+
this.panelPositionContext.set(positionToString(this.layoutService.getPanelPosition()));
|
|
93
|
+
this.panelVisibleContext = PanelVisibleContext.bindTo(this.contextKeyService);
|
|
94
|
+
this.panelVisibleContext.set(this.layoutService.isVisible(Parts.PANEL_PART));
|
|
95
|
+
this.panelMaximizedContext = PanelMaximizedContext.bindTo(this.contextKeyService);
|
|
96
|
+
this.panelMaximizedContext.set(this.layoutService.isPanelMaximized());
|
|
97
|
+
this.panelAlignmentContext = PanelAlignmentContext.bindTo(this.contextKeyService);
|
|
98
|
+
this.panelAlignmentContext.set(this.layoutService.getPanelAlignment());
|
|
99
|
+
this.auxiliaryBarVisibleContext = AuxiliaryBarVisibleContext.bindTo(this.contextKeyService);
|
|
100
|
+
this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible(Parts.AUXILIARYBAR_PART));
|
|
101
|
+
this.registerListeners();
|
|
102
|
+
}
|
|
103
|
+
registerListeners() {
|
|
104
|
+
this.editorGroupService.whenReady.then(() => {
|
|
105
|
+
this.updateEditorAreaContextKeys();
|
|
106
|
+
this.updateActiveEditorGroupContextKeys();
|
|
107
|
+
this.updateVisiblePanesContextKeys();
|
|
108
|
+
});
|
|
109
|
+
this._register(this.editorService.onDidActiveEditorChange(() => this.updateActiveEditorGroupContextKeys()));
|
|
110
|
+
this._register(this.editorService.onDidVisibleEditorsChange(() => this.updateVisiblePanesContextKeys()));
|
|
111
|
+
this._register(this.editorGroupService.onDidAddGroup(() => this.updateEditorGroupsContextKeys()));
|
|
112
|
+
this._register(this.editorGroupService.onDidRemoveGroup(() => this.updateEditorGroupsContextKeys()));
|
|
113
|
+
this._register(this.editorGroupService.onDidChangeGroupIndex(() => this.updateActiveEditorGroupContextKeys()));
|
|
114
|
+
this._register(this.editorGroupService.onDidChangeGroupLocked(() => this.updateActiveEditorGroupContextKeys()));
|
|
115
|
+
this._register(this.editorGroupService.onDidChangeEditorPartOptions(() => this.updateEditorAreaContextKeys()));
|
|
116
|
+
this._register(Event.runAndSubscribe(onDidRegisterWindow, ({ window, disposables }) => disposables.add(addDisposableListener(window, EventType.FOCUS_IN, () => this.updateInputContextKeys(window.document, disposables), true)), { window: mainWindow, disposables: this._store }));
|
|
117
|
+
this._register(this.contextService.onDidChangeWorkbenchState(() => this.updateWorkbenchStateContextKey()));
|
|
118
|
+
this._register(this.contextService.onDidChangeWorkspaceFolders(() => {
|
|
119
|
+
this.updateWorkspaceFolderCountContextKey();
|
|
120
|
+
this.updateWorkspaceContextKeys();
|
|
121
|
+
}));
|
|
122
|
+
this._register(this.configurationService.onDidChangeConfiguration(e => {
|
|
123
|
+
if (e.affectsConfiguration('workbench.editor.openSideBySideDirection')) {
|
|
124
|
+
this.updateSplitEditorsVerticallyContext();
|
|
125
|
+
}
|
|
126
|
+
}));
|
|
127
|
+
this._register(this.layoutService.onDidChangeZenMode(enabled => this.inZenModeContext.set(enabled)));
|
|
128
|
+
this._register(this.layoutService.onDidChangeActiveContainer(() => this.isAuxiliaryWindowFocusedContext.set(this.layoutService.activeContainer !== this.layoutService.mainContainer)));
|
|
129
|
+
this._register(onDidChangeFullscreen(windowId => {
|
|
130
|
+
if (windowId === mainWindow.vscodeWindowId) {
|
|
131
|
+
this.isMainWindowFullscreenContext.set(isFullscreen(mainWindow));
|
|
132
|
+
}
|
|
133
|
+
}));
|
|
134
|
+
this._register(this.layoutService.onDidChangeMainEditorCenteredLayout(centered => this.isMainEditorCenteredLayoutContext.set(centered)));
|
|
135
|
+
this._register(this.layoutService.onDidChangePanelPosition(position => this.panelPositionContext.set(position)));
|
|
136
|
+
this._register(this.layoutService.onDidChangePanelAlignment(alignment => this.panelAlignmentContext.set(alignment)));
|
|
137
|
+
this._register(this.paneCompositeService.onDidPaneCompositeClose(() => this.updateSideBarContextKeys()));
|
|
138
|
+
this._register(this.paneCompositeService.onDidPaneCompositeOpen(() => this.updateSideBarContextKeys()));
|
|
139
|
+
this._register(this.layoutService.onDidChangePartVisibility(() => {
|
|
140
|
+
this.mainEditorAreaVisibleContext.set(this.layoutService.isVisible(Parts.EDITOR_PART, mainWindow));
|
|
141
|
+
this.panelVisibleContext.set(this.layoutService.isVisible(Parts.PANEL_PART));
|
|
142
|
+
this.panelMaximizedContext.set(this.layoutService.isPanelMaximized());
|
|
143
|
+
this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible(Parts.AUXILIARYBAR_PART));
|
|
144
|
+
this.updateTitleBarContextKeys();
|
|
145
|
+
}));
|
|
146
|
+
this._register(this.workingCopyService.onDidChangeDirty(workingCopy => this.dirtyWorkingCopiesContext.set(workingCopy.isDirty() || this.workingCopyService.hasDirty)));
|
|
147
|
+
}
|
|
148
|
+
updateVisiblePanesContextKeys() {
|
|
149
|
+
const visibleEditorPanes = this.editorService.visibleEditorPanes;
|
|
150
|
+
if (visibleEditorPanes.length > 0) {
|
|
151
|
+
this.editorsVisibleContext.set(true);
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
this.editorsVisibleContext.reset();
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
updateActiveEditorGroupContextKeys() {
|
|
158
|
+
if (!this.editorService.activeEditor) {
|
|
159
|
+
this.activeEditorGroupEmpty.set(true);
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
this.activeEditorGroupEmpty.reset();
|
|
163
|
+
}
|
|
164
|
+
const activeGroup = this.editorGroupService.activeGroup;
|
|
165
|
+
this.activeEditorGroupIndex.set(activeGroup.index + 1);
|
|
166
|
+
this.activeEditorGroupLocked.set(activeGroup.isLocked);
|
|
167
|
+
this.updateEditorGroupsContextKeys();
|
|
168
|
+
}
|
|
169
|
+
updateEditorGroupsContextKeys() {
|
|
170
|
+
const groupCount = this.editorGroupService.count;
|
|
171
|
+
if (groupCount > 1) {
|
|
172
|
+
this.multipleEditorGroupsContext.set(true);
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
this.multipleEditorGroupsContext.reset();
|
|
176
|
+
}
|
|
177
|
+
const activeGroup = this.editorGroupService.activeGroup;
|
|
178
|
+
this.activeEditorGroupLast.set(activeGroup.index === groupCount - 1);
|
|
179
|
+
}
|
|
180
|
+
updateEditorAreaContextKeys() {
|
|
181
|
+
this.editorTabsVisibleContext.set(this.editorGroupService.partOptions.showTabs === 'multiple');
|
|
182
|
+
}
|
|
183
|
+
updateInputContextKeys(ownerDocument, disposables) {
|
|
184
|
+
function activeElementIsInput() {
|
|
185
|
+
return !!ownerDocument.activeElement && isEditableElement(ownerDocument.activeElement);
|
|
186
|
+
}
|
|
187
|
+
const isInputFocused = activeElementIsInput();
|
|
188
|
+
this.inputFocusedContext.set(isInputFocused);
|
|
189
|
+
if (isInputFocused) {
|
|
190
|
+
const tracker = disposables.add(trackFocus(ownerDocument.activeElement));
|
|
191
|
+
Event.once(tracker.onDidBlur)(() => {
|
|
192
|
+
if (getActiveWindow().document === ownerDocument) {
|
|
193
|
+
this.inputFocusedContext.set(activeElementIsInput());
|
|
194
|
+
}
|
|
195
|
+
tracker.dispose();
|
|
196
|
+
}, undefined, disposables);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
updateWorkbenchStateContextKey() {
|
|
200
|
+
this.workbenchStateContext.set(this.getWorkbenchStateString());
|
|
201
|
+
}
|
|
202
|
+
updateWorkspaceFolderCountContextKey() {
|
|
203
|
+
this.workspaceFolderCountContext.set(this.contextService.getWorkspace().folders.length);
|
|
204
|
+
}
|
|
205
|
+
updateSplitEditorsVerticallyContext() {
|
|
206
|
+
const direction = preferredSideBySideGroupDirection(this.configurationService);
|
|
207
|
+
this.splitEditorsVerticallyContext.set(direction === GroupDirection.DOWN);
|
|
208
|
+
}
|
|
209
|
+
getWorkbenchStateString() {
|
|
210
|
+
switch (this.contextService.getWorkbenchState()) {
|
|
211
|
+
case WorkbenchState.EMPTY: return 'empty';
|
|
212
|
+
case WorkbenchState.FOLDER: return 'folder';
|
|
213
|
+
case WorkbenchState.WORKSPACE: return 'workspace';
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
updateSideBarContextKeys() {
|
|
217
|
+
this.sideBarVisibleContext.set(this.layoutService.isVisible(Parts.SIDEBAR_PART));
|
|
218
|
+
}
|
|
219
|
+
updateTitleBarContextKeys() {
|
|
220
|
+
this.titleAreaVisibleContext.set(this.layoutService.isVisible(Parts.TITLEBAR_PART, mainWindow));
|
|
221
|
+
this.titleBarStyleContext.set(getTitleBarStyle(this.configurationService));
|
|
222
|
+
}
|
|
223
|
+
updateWorkspaceContextKeys() {
|
|
224
|
+
this.virtualWorkspaceContext.set(getVirtualWorkspaceScheme(this.contextService.getWorkspace()) || '');
|
|
225
|
+
this.temporaryWorkspaceContext.set(isTemporaryWorkspace(this.contextService.getWorkspace()));
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
WorkbenchContextKeysHandler = ( __decorate([
|
|
229
|
+
( __param(0, IContextKeyService)),
|
|
230
|
+
( __param(1, IWorkspaceContextService)),
|
|
231
|
+
( __param(2, IConfigurationService)),
|
|
232
|
+
( __param(3, IWorkbenchEnvironmentService)),
|
|
233
|
+
( __param(4, IProductService)),
|
|
234
|
+
( __param(5, IEditorGroupsService)),
|
|
235
|
+
( __param(6, IEditorService)),
|
|
236
|
+
( __param(7, IWorkbenchLayoutService)),
|
|
237
|
+
( __param(8, IPaneCompositePartService)),
|
|
238
|
+
( __param(9, IWorkingCopyService))
|
|
239
|
+
], WorkbenchContextKeysHandler));
|
|
240
|
+
|
|
241
|
+
export { WorkbenchContextKeysHandler };
|