@theia/preferences 1.77.0-next.95 → 1.77.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/folder-preference-provider.d.ts +1 -1
- package/lib/browser/folder-preference-provider.d.ts.map +1 -1
- package/lib/browser/folder-preference-provider.js +17 -23
- package/lib/browser/folder-preference-provider.js.map +1 -1
- package/lib/browser/folders-preferences-provider.d.ts +3 -3
- package/lib/browser/folders-preferences-provider.d.ts.map +1 -1
- package/lib/browser/folders-preferences-provider.js +30 -40
- package/lib/browser/folders-preferences-provider.js.map +1 -1
- package/lib/browser/frontend-preference-storage.d.ts +2 -2
- package/lib/browser/frontend-preference-storage.d.ts.map +1 -1
- package/lib/browser/frontend-preference-storage.js +5 -9
- package/lib/browser/frontend-preference-storage.js.map +1 -1
- package/lib/browser/index.d.ts +3 -3
- package/lib/browser/index.d.ts.map +1 -1
- package/lib/browser/index.js +4 -7
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/monaco-jsonc-editor.js +10 -14
- package/lib/browser/monaco-jsonc-editor.js.map +1 -1
- package/lib/browser/package.spec.d.ts +1 -0
- package/lib/browser/package.spec.js +1 -1
- package/lib/browser/package.spec.js.map +1 -1
- package/lib/browser/preference-bindings.js +23 -27
- package/lib/browser/preference-bindings.js.map +1 -1
- package/lib/browser/preference-frontend-contribution.d.ts +9 -6
- package/lib/browser/preference-frontend-contribution.d.ts.map +1 -1
- package/lib/browser/preference-frontend-contribution.js +34 -38
- package/lib/browser/preference-frontend-contribution.js.map +1 -1
- package/lib/browser/preference-frontend-contribution.spec.js +30 -16
- package/lib/browser/preference-frontend-contribution.spec.js.map +1 -1
- package/lib/browser/preference-frontend-module.d.ts +1 -1
- package/lib/browser/preference-frontend-module.d.ts.map +1 -1
- package/lib/browser/preference-frontend-module.js +51 -54
- package/lib/browser/preference-frontend-module.js.map +1 -1
- package/lib/browser/preference-open-handler.d.ts +1 -1
- package/lib/browser/preference-open-handler.d.ts.map +1 -1
- package/lib/browser/preference-open-handler.js +10 -14
- package/lib/browser/preference-open-handler.js.map +1 -1
- package/lib/browser/preference-transaction-manager.d.ts +2 -2
- package/lib/browser/preference-transaction-manager.d.ts.map +1 -1
- package/lib/browser/preference-transaction-manager.js +49 -63
- package/lib/browser/preference-transaction-manager.js.map +1 -1
- package/lib/browser/preference-tree-model.d.ts +4 -4
- package/lib/browser/preference-tree-model.d.ts.map +1 -1
- package/lib/browser/preference-tree-model.js +48 -59
- package/lib/browser/preference-tree-model.js.map +1 -1
- package/lib/browser/preference-tree-model.spec.js +84 -86
- package/lib/browser/preference-tree-model.spec.js.map +1 -1
- package/lib/browser/preferences-contribution.d.ts +2 -2
- package/lib/browser/preferences-contribution.d.ts.map +1 -1
- package/lib/browser/preferences-contribution.js +76 -86
- package/lib/browser/preferences-contribution.js.map +1 -1
- package/lib/browser/preferences-json-schema-contribution.js +34 -41
- package/lib/browser/preferences-json-schema-contribution.js.map +1 -1
- package/lib/browser/preferences-monaco-contribution.js +1 -4
- package/lib/browser/preferences-monaco-contribution.js.map +1 -1
- package/lib/browser/session-preference-remote-cli-contribution.js +13 -17
- package/lib/browser/session-preference-remote-cli-contribution.js.map +1 -1
- package/lib/browser/session-preference-remote-cli-contribution.spec.js +8 -10
- package/lib/browser/session-preference-remote-cli-contribution.spec.js.map +1 -1
- package/lib/browser/session-preference-status-bar-contribution.js +34 -43
- package/lib/browser/session-preference-status-bar-contribution.js.map +1 -1
- package/lib/browser/util/preference-layout.js +74 -77
- package/lib/browser/util/preference-layout.js.map +1 -1
- package/lib/browser/util/preference-layout.spec.js +6 -8
- package/lib/browser/util/preference-layout.spec.js.map +1 -1
- package/lib/browser/util/preference-scope-command-manager.js +19 -25
- package/lib/browser/util/preference-scope-command-manager.js.map +1 -1
- package/lib/browser/util/preference-tree-generator.d.ts +3 -3
- package/lib/browser/util/preference-tree-generator.d.ts.map +1 -1
- package/lib/browser/util/preference-tree-generator.js +31 -41
- package/lib/browser/util/preference-tree-generator.js.map +1 -1
- package/lib/browser/util/preference-tree-label-provider.d.ts +2 -2
- package/lib/browser/util/preference-tree-label-provider.d.ts.map +1 -1
- package/lib/browser/util/preference-tree-label-provider.js +14 -18
- package/lib/browser/util/preference-tree-label-provider.js.map +1 -1
- package/lib/browser/util/preference-tree-label-provider.spec.js +21 -23
- package/lib/browser/util/preference-tree-label-provider.spec.js.map +1 -1
- package/lib/browser/util/preference-types.js +27 -30
- package/lib/browser/util/preference-types.js.map +1 -1
- package/lib/browser/views/components/preference-array-input.d.ts +3 -3
- package/lib/browser/views/components/preference-array-input.d.ts.map +1 -1
- package/lib/browser/views/components/preference-array-input.js +17 -20
- package/lib/browser/views/components/preference-array-input.js.map +1 -1
- package/lib/browser/views/components/preference-boolean-input.d.ts +3 -3
- package/lib/browser/views/components/preference-boolean-input.d.ts.map +1 -1
- package/lib/browser/views/components/preference-boolean-input.js +14 -17
- package/lib/browser/views/components/preference-boolean-input.js.map +1 -1
- package/lib/browser/views/components/preference-file-input.d.ts +4 -4
- package/lib/browser/views/components/preference-file-input.d.ts.map +1 -1
- package/lib/browser/views/components/preference-file-input.js +23 -27
- package/lib/browser/views/components/preference-file-input.js.map +1 -1
- package/lib/browser/views/components/preference-json-input.d.ts +3 -3
- package/lib/browser/views/components/preference-json-input.d.ts.map +1 -1
- package/lib/browser/views/components/preference-json-input.js +18 -22
- package/lib/browser/views/components/preference-json-input.js.map +1 -1
- package/lib/browser/views/components/preference-markdown-renderer.d.ts +2 -2
- package/lib/browser/views/components/preference-markdown-renderer.d.ts.map +1 -1
- package/lib/browser/views/components/preference-markdown-renderer.js +20 -27
- package/lib/browser/views/components/preference-markdown-renderer.js.map +1 -1
- package/lib/browser/views/components/preference-node-renderer-creator.d.ts +2 -2
- package/lib/browser/views/components/preference-node-renderer-creator.d.ts.map +1 -1
- package/lib/browser/views/components/preference-node-renderer-creator.js +31 -36
- package/lib/browser/views/components/preference-node-renderer-creator.js.map +1 -1
- package/lib/browser/views/components/preference-node-renderer.d.ts +6 -6
- package/lib/browser/views/components/preference-node-renderer.d.ts.map +1 -1
- package/lib/browser/views/components/preference-node-renderer.js +70 -90
- package/lib/browser/views/components/preference-node-renderer.js.map +1 -1
- package/lib/browser/views/components/preference-null-input.d.ts +3 -3
- package/lib/browser/views/components/preference-null-input.d.ts.map +1 -1
- package/lib/browser/views/components/preference-null-input.js +12 -15
- package/lib/browser/views/components/preference-null-input.js.map +1 -1
- package/lib/browser/views/components/preference-number-input.d.ts +3 -3
- package/lib/browser/views/components/preference-number-input.d.ts.map +1 -1
- package/lib/browser/views/components/preference-number-input.js +29 -32
- package/lib/browser/views/components/preference-number-input.js.map +1 -1
- package/lib/browser/views/components/preference-select-input.d.ts +3 -3
- package/lib/browser/views/components/preference-select-input.d.ts.map +1 -1
- package/lib/browser/views/components/preference-select-input.js +23 -26
- package/lib/browser/views/components/preference-select-input.js.map +1 -1
- package/lib/browser/views/components/preference-string-input.d.ts +3 -3
- package/lib/browser/views/components/preference-string-input.d.ts.map +1 -1
- package/lib/browser/views/components/preference-string-input.js +14 -17
- package/lib/browser/views/components/preference-string-input.js.map +1 -1
- package/lib/browser/views/preference-editor-widget.d.ts +5 -5
- package/lib/browser/views/preference-editor-widget.d.ts.map +1 -1
- package/lib/browser/views/preference-editor-widget.js +65 -78
- package/lib/browser/views/preference-editor-widget.js.map +1 -1
- package/lib/browser/views/preference-scope-tabbar-widget.d.ts +2 -2
- package/lib/browser/views/preference-scope-tabbar-widget.d.ts.map +1 -1
- package/lib/browser/views/preference-scope-tabbar-widget.js +51 -63
- package/lib/browser/views/preference-scope-tabbar-widget.js.map +1 -1
- package/lib/browser/views/preference-searchbar-widget.js +23 -30
- package/lib/browser/views/preference-searchbar-widget.js.map +1 -1
- package/lib/browser/views/preference-tree-widget.d.ts +3 -3
- package/lib/browser/views/preference-tree-widget.d.ts.map +1 -1
- package/lib/browser/views/preference-tree-widget.js +23 -31
- package/lib/browser/views/preference-tree-widget.js.map +1 -1
- package/lib/browser/views/preference-widget-bindings.js +60 -64
- package/lib/browser/views/preference-widget-bindings.js.map +1 -1
- package/lib/browser/views/preference-widget.d.ts +5 -5
- package/lib/browser/views/preference-widget.d.ts.map +1 -1
- package/lib/browser/views/preference-widget.js +24 -34
- package/lib/browser/views/preference-widget.js.map +1 -1
- package/lib/browser/workspace-file-preference-provider.d.ts +2 -2
- package/lib/browser/workspace-file-preference-provider.d.ts.map +1 -1
- package/lib/browser/workspace-file-preference-provider.js +21 -26
- package/lib/browser/workspace-file-preference-provider.js.map +1 -1
- package/lib/browser/workspace-preference-provider.d.ts +5 -5
- package/lib/browser/workspace-preference-provider.d.ts.map +1 -1
- package/lib/browser/workspace-preference-provider.js +31 -40
- package/lib/browser/workspace-preference-provider.js.map +1 -1
- package/lib/common/abstract-resource-preference-provider.d.ts +2 -2
- package/lib/common/abstract-resource-preference-provider.d.ts.map +1 -1
- package/lib/common/abstract-resource-preference-provider.js +55 -68
- package/lib/common/abstract-resource-preference-provider.js.map +1 -1
- package/lib/common/abstract-resource-preference-provider.spec.js +34 -36
- package/lib/common/abstract-resource-preference-provider.spec.js.map +1 -1
- package/lib/common/cli-preferences.d.ts +28 -6
- package/lib/common/cli-preferences.d.ts.map +1 -1
- package/lib/common/cli-preferences.js +34 -11
- package/lib/common/cli-preferences.js.map +1 -1
- package/lib/common/cli-preferences.spec.js +63 -18
- package/lib/common/cli-preferences.spec.js.map +1 -1
- package/lib/common/jsonc-editor.js +13 -17
- package/lib/common/jsonc-editor.js.map +1 -1
- package/lib/common/section-preference-provider.d.ts +2 -2
- package/lib/common/section-preference-provider.d.ts.map +1 -1
- package/lib/common/section-preference-provider.js +18 -25
- package/lib/common/section-preference-provider.js.map +1 -1
- package/lib/common/user-configs-preference-provider.d.ts +3 -3
- package/lib/common/user-configs-preference-provider.d.ts.map +1 -1
- package/lib/common/user-configs-preference-provider.js +26 -36
- package/lib/common/user-configs-preference-provider.js.map +1 -1
- package/lib/common/user-preference-provider.d.ts +1 -1
- package/lib/common/user-preference-provider.d.ts.map +1 -1
- package/lib/common/user-preference-provider.js +10 -13
- package/lib/common/user-preference-provider.js.map +1 -1
- package/lib/node/backend-preference-storage.d.ts +2 -2
- package/lib/node/backend-preference-storage.d.ts.map +1 -1
- package/lib/node/backend-preference-storage.js +12 -16
- package/lib/node/backend-preference-storage.js.map +1 -1
- package/lib/node/backend-preference-storage.spec.js +10 -12
- package/lib/node/backend-preference-storage.spec.js.map +1 -1
- package/lib/node/preference-backend-module.js +23 -25
- package/lib/node/preference-backend-module.js.map +1 -1
- package/lib/node/preference-bindings.js +11 -14
- package/lib/node/preference-bindings.js.map +1 -1
- package/lib/node/preference-cli-contribution.d.ts +8 -7
- package/lib/node/preference-cli-contribution.d.ts.map +1 -1
- package/lib/node/preference-cli-contribution.js +18 -19
- package/lib/node/preference-cli-contribution.js.map +1 -1
- package/lib/node/preference-cli-contribution.spec.js +63 -38
- package/lib/node/preference-cli-contribution.spec.js.map +1 -1
- package/package.json +18 -9
- package/src/browser/folder-preference-provider.ts +1 -1
- package/src/browser/folders-preferences-provider.ts +6 -6
- package/src/browser/frontend-preference-storage.ts +2 -2
- package/src/browser/index.ts +3 -3
- package/src/browser/preference-bindings.ts +7 -7
- package/src/browser/preference-frontend-contribution.spec.ts +31 -11
- package/src/browser/preference-frontend-contribution.ts +18 -15
- package/src/browser/preference-frontend-module.ts +18 -18
- package/src/browser/preference-open-handler.ts +1 -1
- package/src/browser/preference-transaction-manager.ts +2 -2
- package/src/browser/preference-tree-model.spec.ts +6 -6
- package/src/browser/preference-tree-model.ts +5 -5
- package/src/browser/preferences-contribution.ts +2 -2
- package/src/browser/preferences-json-schema-contribution.ts +1 -1
- package/src/browser/session-preference-remote-cli-contribution.spec.ts +3 -3
- package/src/browser/session-preference-remote-cli-contribution.ts +1 -1
- package/src/browser/session-preference-status-bar-contribution.ts +2 -2
- package/src/browser/util/preference-layout.spec.ts +1 -1
- package/src/browser/util/preference-layout.ts +1 -1
- package/src/browser/util/preference-scope-command-manager.ts +1 -1
- package/src/browser/util/preference-tree-generator.ts +4 -4
- package/src/browser/util/preference-tree-label-provider.spec.ts +4 -4
- package/src/browser/util/preference-tree-label-provider.ts +2 -2
- package/src/browser/views/components/preference-array-input.ts +3 -3
- package/src/browser/views/components/preference-boolean-input.ts +3 -3
- package/src/browser/views/components/preference-file-input.ts +5 -5
- package/src/browser/views/components/preference-json-input.ts +3 -3
- package/src/browser/views/components/preference-markdown-renderer.ts +2 -2
- package/src/browser/views/components/preference-node-renderer-creator.ts +2 -2
- package/src/browser/views/components/preference-node-renderer.ts +7 -7
- package/src/browser/views/components/preference-null-input.ts +3 -3
- package/src/browser/views/components/preference-number-input.ts +3 -3
- package/src/browser/views/components/preference-select-input.ts +3 -3
- package/src/browser/views/components/preference-string-input.ts +3 -3
- package/src/browser/views/preference-editor-widget.ts +10 -10
- package/src/browser/views/preference-scope-tabbar-widget.tsx +2 -2
- package/src/browser/views/preference-searchbar-widget.tsx +1 -1
- package/src/browser/views/preference-tree-widget.tsx +3 -3
- package/src/browser/views/preference-widget-bindings.ts +19 -19
- package/src/browser/views/preference-widget.tsx +5 -5
- package/src/browser/workspace-file-preference-provider.ts +3 -3
- package/src/browser/workspace-preference-provider.ts +8 -9
- package/src/common/abstract-resource-preference-provider.spec.ts +2 -2
- package/src/common/abstract-resource-preference-provider.ts +23 -24
- package/src/common/cli-preferences.spec.ts +62 -9
- package/src/common/cli-preferences.ts +48 -9
- package/src/common/jsonc-editor.ts +3 -3
- package/src/common/section-preference-provider.ts +3 -3
- package/src/common/user-configs-preference-provider.ts +5 -5
- package/src/common/user-preference-provider.ts +1 -1
- package/src/node/backend-preference-storage.spec.ts +2 -2
- package/src/node/backend-preference-storage.ts +3 -3
- package/src/node/preference-backend-module.ts +6 -6
- package/src/node/preference-bindings.ts +3 -3
- package/src/node/preference-cli-contribution.spec.ts +46 -15
- package/src/node/preference-cli-contribution.ts +12 -9
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// *****************************************************************************
|
|
3
2
|
// Copyright (C) 2018 Ericsson and others.
|
|
4
3
|
//
|
|
@@ -14,34 +13,32 @@
|
|
|
14
13
|
//
|
|
15
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
15
|
// *****************************************************************************
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const browser_3 = require("@theia/workspace/lib/browser");
|
|
30
|
-
let PreferencesContribution = class PreferencesContribution extends browser_1.AbstractViewContribution {
|
|
16
|
+
import { __decorate } from "tslib";
|
|
17
|
+
import { injectable, inject, optional } from '@theia/core/shared/inversify';
|
|
18
|
+
import { nls, PreferenceScope, PreferenceService } from '@theia/core';
|
|
19
|
+
import { CommonMenus, AbstractViewContribution, CommonCommands, QuickInputService, isFirefox, } from '@theia/core/lib/browser';
|
|
20
|
+
import { isOSX } from '@theia/core/lib/common/os';
|
|
21
|
+
import { EditorManager } from '@theia/editor/lib/browser';
|
|
22
|
+
import { PreferencesWidget } from './views/preference-widget.js';
|
|
23
|
+
import { Preference, PreferencesCommands, PreferenceMenus } from './util/preference-types.js';
|
|
24
|
+
import { ClipboardService } from '@theia/core/lib/browser/clipboard-service';
|
|
25
|
+
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
26
|
+
import { WorkspaceService } from '@theia/workspace/lib/browser';
|
|
27
|
+
let PreferencesContribution = class PreferencesContribution extends AbstractViewContribution {
|
|
31
28
|
constructor() {
|
|
32
29
|
super({
|
|
33
|
-
widgetId:
|
|
34
|
-
widgetName:
|
|
30
|
+
widgetId: PreferencesWidget.ID,
|
|
31
|
+
widgetName: PreferencesWidget.LABEL,
|
|
35
32
|
defaultWidgetOptions: {
|
|
36
33
|
area: 'main',
|
|
37
34
|
},
|
|
38
35
|
});
|
|
39
36
|
}
|
|
40
37
|
get currentScope() {
|
|
41
|
-
return this.tryGetWidget()?.currentScope ??
|
|
38
|
+
return this.tryGetWidget()?.currentScope ?? Preference.DEFAULT_SCOPE;
|
|
42
39
|
}
|
|
43
40
|
registerCommands(commands) {
|
|
44
|
-
commands.registerCommand(
|
|
41
|
+
commands.registerCommand(CommonCommands.OPEN_PREFERENCES, {
|
|
45
42
|
execute: async (query) => {
|
|
46
43
|
const widget = await this.openView({ activate: true });
|
|
47
44
|
if (typeof query === 'string') {
|
|
@@ -49,51 +46,51 @@ let PreferencesContribution = class PreferencesContribution extends browser_1.Ab
|
|
|
49
46
|
}
|
|
50
47
|
},
|
|
51
48
|
});
|
|
52
|
-
commands.registerCommand(
|
|
49
|
+
commands.registerCommand(PreferencesCommands.OPEN_PREFERENCES_JSON_TOOLBAR, {
|
|
53
50
|
isEnabled: () => true,
|
|
54
51
|
isVisible: w => this.withWidget(w, () => true),
|
|
55
52
|
execute: (preferenceId) => {
|
|
56
53
|
this.openPreferencesJSON(preferenceId);
|
|
57
54
|
}
|
|
58
55
|
});
|
|
59
|
-
commands.registerCommand(
|
|
60
|
-
isEnabled:
|
|
61
|
-
isVisible:
|
|
56
|
+
commands.registerCommand(PreferencesCommands.COPY_JSON_NAME, {
|
|
57
|
+
isEnabled: Preference.EditorCommandArgs.is,
|
|
58
|
+
isVisible: Preference.EditorCommandArgs.is,
|
|
62
59
|
execute: ({ id, value }) => {
|
|
63
60
|
this.clipboardService.writeText(id);
|
|
64
61
|
}
|
|
65
62
|
});
|
|
66
|
-
commands.registerCommand(
|
|
67
|
-
isEnabled:
|
|
68
|
-
isVisible:
|
|
63
|
+
commands.registerCommand(PreferencesCommands.COPY_JSON_VALUE, {
|
|
64
|
+
isEnabled: Preference.EditorCommandArgs.is,
|
|
65
|
+
isVisible: Preference.EditorCommandArgs.is,
|
|
69
66
|
execute: ({ id, value }) => {
|
|
70
67
|
const jsonString = `"${id}": ${JSON.stringify(value)}`;
|
|
71
68
|
this.clipboardService.writeText(jsonString);
|
|
72
69
|
}
|
|
73
70
|
});
|
|
74
|
-
commands.registerCommand(
|
|
75
|
-
isEnabled:
|
|
76
|
-
isVisible:
|
|
71
|
+
commands.registerCommand(PreferencesCommands.RESET_PREFERENCE, {
|
|
72
|
+
isEnabled: Preference.EditorCommandArgs.is,
|
|
73
|
+
isVisible: Preference.EditorCommandArgs.is,
|
|
77
74
|
execute: ({ id }) => {
|
|
78
75
|
const { scope, uri } = this.currentScope;
|
|
79
76
|
return this.preferenceService.set(id, undefined, Number(scope), uri);
|
|
80
77
|
}
|
|
81
78
|
});
|
|
82
|
-
commands.registerCommand(
|
|
79
|
+
commands.registerCommand(PreferencesCommands.OPEN_USER_PREFERENCES, {
|
|
83
80
|
execute: async () => {
|
|
84
81
|
const widget = await this.openView({ activate: true });
|
|
85
|
-
widget.setScope(
|
|
82
|
+
widget.setScope(PreferenceScope.User);
|
|
86
83
|
}
|
|
87
84
|
});
|
|
88
|
-
commands.registerCommand(
|
|
85
|
+
commands.registerCommand(PreferencesCommands.OPEN_WORKSPACE_PREFERENCES, {
|
|
89
86
|
isEnabled: () => !!this.workspaceService.workspace,
|
|
90
87
|
isVisible: () => !!this.workspaceService.workspace,
|
|
91
88
|
execute: async () => {
|
|
92
89
|
const widget = await this.openView({ activate: true });
|
|
93
|
-
widget.setScope(
|
|
90
|
+
widget.setScope(PreferenceScope.Workspace);
|
|
94
91
|
}
|
|
95
92
|
});
|
|
96
|
-
commands.registerCommand(
|
|
93
|
+
commands.registerCommand(PreferencesCommands.OPEN_FOLDER_PREFERENCES, {
|
|
97
94
|
isEnabled: () => !!this.workspaceService.isMultiRootWorkspaceOpened && this.workspaceService.tryGetRoots().length > 0,
|
|
98
95
|
isVisible: () => !!this.workspaceService.isMultiRootWorkspaceOpened && this.workspaceService.tryGetRoots().length > 0,
|
|
99
96
|
execute: () => this.openFolderPreferences(async (root) => {
|
|
@@ -101,58 +98,58 @@ let PreferencesContribution = class PreferencesContribution extends browser_1.Ab
|
|
|
101
98
|
widget.setScope(root.resource);
|
|
102
99
|
})
|
|
103
100
|
});
|
|
104
|
-
commands.registerCommand(
|
|
105
|
-
execute: async () => this.openJson(
|
|
101
|
+
commands.registerCommand(PreferencesCommands.OPEN_USER_PREFERENCES_JSON, {
|
|
102
|
+
execute: async () => this.openJson(PreferenceScope.User)
|
|
106
103
|
});
|
|
107
|
-
commands.registerCommand(
|
|
104
|
+
commands.registerCommand(PreferencesCommands.OPEN_WORKSPACE_PREFERENCES_JSON, {
|
|
108
105
|
isEnabled: () => !!this.workspaceService.workspace,
|
|
109
106
|
isVisible: () => !!this.workspaceService.workspace,
|
|
110
|
-
execute: async () => this.openJson(
|
|
107
|
+
execute: async () => this.openJson(PreferenceScope.Workspace)
|
|
111
108
|
});
|
|
112
|
-
commands.registerCommand(
|
|
109
|
+
commands.registerCommand(PreferencesCommands.OPEN_FOLDER_PREFERENCES_JSON, {
|
|
113
110
|
isEnabled: () => !!this.workspaceService.isMultiRootWorkspaceOpened && this.workspaceService.tryGetRoots().length > 0,
|
|
114
111
|
isVisible: () => !!this.workspaceService.isMultiRootWorkspaceOpened && this.workspaceService.tryGetRoots().length > 0,
|
|
115
|
-
execute: () => this.openFolderPreferences(root => this.openJson(
|
|
112
|
+
execute: () => this.openFolderPreferences(root => this.openJson(PreferenceScope.Folder, root.resource.toString()))
|
|
116
113
|
});
|
|
117
114
|
}
|
|
118
115
|
registerMenus(menus) {
|
|
119
|
-
menus.registerMenuAction(
|
|
120
|
-
commandId:
|
|
121
|
-
label:
|
|
116
|
+
menus.registerMenuAction(CommonMenus.FILE_SETTINGS_SUBMENU_OPEN, {
|
|
117
|
+
commandId: CommonCommands.OPEN_PREFERENCES.id,
|
|
118
|
+
label: nls.localizeByDefault('Settings'),
|
|
122
119
|
order: 'a10',
|
|
123
120
|
});
|
|
124
|
-
menus.registerMenuAction(
|
|
125
|
-
commandId:
|
|
126
|
-
label:
|
|
121
|
+
menus.registerMenuAction(CommonMenus.MANAGE_SETTINGS, {
|
|
122
|
+
commandId: CommonCommands.OPEN_PREFERENCES.id,
|
|
123
|
+
label: nls.localizeByDefault('Settings'),
|
|
127
124
|
order: 'a10',
|
|
128
125
|
});
|
|
129
|
-
menus.registerMenuAction(
|
|
130
|
-
commandId:
|
|
131
|
-
label:
|
|
126
|
+
menus.registerMenuAction(PreferenceMenus.PREFERENCE_EDITOR_CONTEXT_MENU, {
|
|
127
|
+
commandId: PreferencesCommands.RESET_PREFERENCE.id,
|
|
128
|
+
label: PreferencesCommands.RESET_PREFERENCE.label,
|
|
132
129
|
order: 'a'
|
|
133
130
|
});
|
|
134
|
-
menus.registerMenuAction(
|
|
135
|
-
commandId:
|
|
136
|
-
label:
|
|
131
|
+
menus.registerMenuAction(PreferenceMenus.PREFERENCE_EDITOR_COPY_ACTIONS, {
|
|
132
|
+
commandId: PreferencesCommands.COPY_JSON_VALUE.id,
|
|
133
|
+
label: PreferencesCommands.COPY_JSON_VALUE.label,
|
|
137
134
|
order: 'b'
|
|
138
135
|
});
|
|
139
|
-
menus.registerMenuAction(
|
|
140
|
-
commandId:
|
|
141
|
-
label:
|
|
136
|
+
menus.registerMenuAction(PreferenceMenus.PREFERENCE_EDITOR_COPY_ACTIONS, {
|
|
137
|
+
commandId: PreferencesCommands.COPY_JSON_NAME.id,
|
|
138
|
+
label: PreferencesCommands.COPY_JSON_NAME.label,
|
|
142
139
|
order: 'c'
|
|
143
140
|
});
|
|
144
141
|
}
|
|
145
142
|
registerKeybindings(keybindings) {
|
|
146
143
|
keybindings.registerKeybinding({
|
|
147
|
-
command:
|
|
148
|
-
keybinding: (
|
|
144
|
+
command: CommonCommands.OPEN_PREFERENCES.id,
|
|
145
|
+
keybinding: (isOSX && !isFirefox) ? 'cmd+,' : 'ctrl+,'
|
|
149
146
|
});
|
|
150
147
|
}
|
|
151
148
|
registerToolbarItems(toolbar) {
|
|
152
149
|
toolbar.registerItem({
|
|
153
|
-
id:
|
|
154
|
-
command:
|
|
155
|
-
tooltip:
|
|
150
|
+
id: PreferencesCommands.OPEN_PREFERENCES_JSON_TOOLBAR.id,
|
|
151
|
+
command: PreferencesCommands.OPEN_PREFERENCES_JSON_TOOLBAR.id,
|
|
152
|
+
tooltip: PreferencesCommands.OPEN_USER_PREFERENCES_JSON.label,
|
|
156
153
|
priority: 0,
|
|
157
154
|
});
|
|
158
155
|
}
|
|
@@ -163,7 +160,7 @@ let PreferencesContribution = class PreferencesContribution extends browser_1.Ab
|
|
|
163
160
|
if (typeof opener === 'string') {
|
|
164
161
|
preferenceId = opener;
|
|
165
162
|
const currentPreferenceValue = this.preferenceService.inspect(preferenceId, uri);
|
|
166
|
-
const valueInCurrentScope =
|
|
163
|
+
const valueInCurrentScope = Preference.getValueInScope(currentPreferenceValue, scopeID) ?? currentPreferenceValue?.defaultValue;
|
|
167
164
|
this.preferenceService.set(preferenceId, valueInCurrentScope, scopeID, uri);
|
|
168
165
|
}
|
|
169
166
|
let jsonEditorWidget;
|
|
@@ -206,7 +203,7 @@ let PreferencesContribution = class PreferencesContribution extends browser_1.Ab
|
|
|
206
203
|
async obtainConfigUri(serializedScope, activeScopeIsFolder, resource) {
|
|
207
204
|
let scope = serializedScope;
|
|
208
205
|
if (activeScopeIsFolder) {
|
|
209
|
-
scope =
|
|
206
|
+
scope = PreferenceScope.Folder;
|
|
210
207
|
}
|
|
211
208
|
const resourceUri = !!resource ? resource : undefined;
|
|
212
209
|
const configUri = this.preferenceService.getConfigUri(scope, resourceUri);
|
|
@@ -222,40 +219,33 @@ let PreferencesContribution = class PreferencesContribution extends browser_1.Ab
|
|
|
222
219
|
* Determine if the current widget is the PreferencesWidget.
|
|
223
220
|
*/
|
|
224
221
|
withWidget(widget = this.tryGetWidget(), fn) {
|
|
225
|
-
if (widget instanceof
|
|
222
|
+
if (widget instanceof PreferencesWidget && widget.id === PreferencesWidget.ID) {
|
|
226
223
|
return fn(widget);
|
|
227
224
|
}
|
|
228
225
|
return false;
|
|
229
226
|
}
|
|
230
227
|
};
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
(0, inversify_1.inject)(file_service_1.FileService),
|
|
234
|
-
tslib_1.__metadata("design:type", file_service_1.FileService)
|
|
228
|
+
__decorate([
|
|
229
|
+
inject(FileService)
|
|
235
230
|
], PreferencesContribution.prototype, "fileService", void 0);
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
tslib_1.__metadata("design:type", browser_2.EditorManager)
|
|
231
|
+
__decorate([
|
|
232
|
+
inject(EditorManager)
|
|
239
233
|
], PreferencesContribution.prototype, "editorManager", void 0);
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
tslib_1.__metadata("design:type", Object)
|
|
234
|
+
__decorate([
|
|
235
|
+
inject(PreferenceService)
|
|
243
236
|
], PreferencesContribution.prototype, "preferenceService", void 0);
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
tslib_1.__metadata("design:type", Object)
|
|
237
|
+
__decorate([
|
|
238
|
+
inject(ClipboardService)
|
|
247
239
|
], PreferencesContribution.prototype, "clipboardService", void 0);
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
tslib_1.__metadata("design:type", browser_3.WorkspaceService)
|
|
240
|
+
__decorate([
|
|
241
|
+
inject(WorkspaceService)
|
|
251
242
|
], PreferencesContribution.prototype, "workspaceService", void 0);
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
tslib_1.__metadata("design:type", Object)
|
|
243
|
+
__decorate([
|
|
244
|
+
inject(QuickInputService),
|
|
245
|
+
optional()
|
|
256
246
|
], PreferencesContribution.prototype, "quickInputService", void 0);
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
247
|
+
PreferencesContribution = __decorate([
|
|
248
|
+
injectable()
|
|
260
249
|
], PreferencesContribution);
|
|
250
|
+
export { PreferencesContribution };
|
|
261
251
|
//# sourceMappingURL=preferences-contribution.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preferences-contribution.js","sourceRoot":"","sources":["../../src/browser/preferences-contribution.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"preferences-contribution.js","sourceRoot":"","sources":["../../src/browser/preferences-contribution.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAsC,GAAG,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC1G,OAAO,EACH,WAAW,EACX,wBAAwB,EACxB,cAAc,EAGd,iBAAiB,EAEjB,SAAS,GACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAElD,OAAO,EAAE,aAAa,EAAgB,MAAM,2BAA2B,CAAC;AAExE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAIzD,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,wBAA2C;IASpF;QACI,KAAK,CAAC;YACF,QAAQ,EAAE,iBAAiB,CAAC,EAAE;YAC9B,UAAU,EAAE,iBAAiB,CAAC,KAAK;YACnC,oBAAoB,EAAE;gBAClB,IAAI,EAAE,MAAM;aACf;SACJ,CAA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AW,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;QACtD,MAAM,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QAC1E,IAAI,CAAC,SAAS,EAAE,CAAC;YACb,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,IAAI,SAAS,IAAI,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;YACzD,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;IAED;;OAEG;IACO,UAAU,CAAI,SAA6B,IAAI,CAAC,YAAY,EAAE,EAAE,EAAoC;QAC1G,IAAI,MAAM,YAAY,iBAAiB,IAAI,MAAM,CAAC,EAAE,KAAK,iBAAiB,CAAC,EAAE,EAAE,CAAC;YAC5E,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC;QACtB,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ,CAAA;AAzN2C;IAAvC,MAAM,CAAC,WAAW,CAAC;4DAA6C;AACvB;IAAzC,MAAM,CAAC,aAAa,CAAC;8DAAiD;AACzB;IAA7C,MAAM,CAAC,iBAAiB,CAAC;kEAAyD;AACtC;IAA5C,MAAM,CAAC,gBAAgB,CAAC;iEAAuD;AACnC;IAA5C,MAAM,CAAC,gBAAgB,CAAC;iEAAuD;AACtB;IAAzD,MAAM,CAAC,iBAAiB,CAAC;IAAE,QAAQ,EAAE;kEAAyD;AAPtF,uBAAuB;IADnC,UAAU,EAAE;GACA,uBAAuB,CA2NnC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// *****************************************************************************
|
|
3
2
|
// Copyright (C) 2018 TypeFox and others.
|
|
4
3
|
//
|
|
@@ -14,16 +13,14 @@
|
|
|
14
13
|
//
|
|
15
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
15
|
// *****************************************************************************
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const browser_2 = require("@theia/userstorage/lib/browser");
|
|
26
|
-
const debounce = require("@theia/core/shared/lodash.debounce");
|
|
16
|
+
import { __decorate } from "tslib";
|
|
17
|
+
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
18
|
+
import URI from '@theia/core/lib/common/uri';
|
|
19
|
+
import { JsonSchemaDataStore } from '@theia/core/lib/browser/json-schema-store';
|
|
20
|
+
import { WorkspaceService } from '@theia/workspace/lib/browser';
|
|
21
|
+
import { PreferenceSchemaService, PreferenceConfigurations, PreferenceScope } from '@theia/core';
|
|
22
|
+
import { UserStorageUri } from '@theia/userstorage/lib/browser';
|
|
23
|
+
import debounce from '@theia/core/shared/lodash.debounce';
|
|
27
24
|
const PREFERENCE_URI_PREFIX = 'vscode://schemas/settings/';
|
|
28
25
|
const DEBOUNCED_UPDATE_DELAY = 200;
|
|
29
26
|
let PreferencesJsonSchemaContribution = class PreferencesJsonSchemaContribution {
|
|
@@ -31,54 +28,50 @@ let PreferencesJsonSchemaContribution = class PreferencesJsonSchemaContribution
|
|
|
31
28
|
this.debouncedUpdateInMemoryResources = debounce(() => this.updateInMemoryResources(), DEBOUNCED_UPDATE_DELAY);
|
|
32
29
|
}
|
|
33
30
|
registerSchemas(context) {
|
|
34
|
-
this.registerSchema(
|
|
35
|
-
this.registerSchema(
|
|
36
|
-
this.registerSchema(
|
|
37
|
-
this.registerSchema(
|
|
31
|
+
this.registerSchema(PreferenceScope.Default, context);
|
|
32
|
+
this.registerSchema(PreferenceScope.User, context);
|
|
33
|
+
this.registerSchema(PreferenceScope.Workspace, context);
|
|
34
|
+
this.registerSchema(PreferenceScope.Folder, context);
|
|
38
35
|
context.registerSchema({
|
|
39
36
|
fileMatch: `file://**/${this.preferenceConfigurations.getConfigName()}.json`,
|
|
40
|
-
url: this.getSchemaURIForScope(
|
|
37
|
+
url: this.getSchemaURIForScope(PreferenceScope.Folder).toString()
|
|
41
38
|
});
|
|
42
39
|
context.registerSchema({
|
|
43
|
-
fileMatch:
|
|
44
|
-
url: this.getSchemaURIForScope(
|
|
40
|
+
fileMatch: UserStorageUri.resolve(this.preferenceConfigurations.getConfigName() + '.json').toString(),
|
|
41
|
+
url: this.getSchemaURIForScope(PreferenceScope.User).toString()
|
|
45
42
|
});
|
|
46
|
-
this.workspaceService.updateSchema('settings', { $ref: this.getSchemaURIForScope(
|
|
43
|
+
this.workspaceService.updateSchema('settings', { $ref: this.getSchemaURIForScope(PreferenceScope.Workspace).toString() });
|
|
47
44
|
this.schemaProvider.onDidChangeSchema(() => this.debouncedUpdateInMemoryResources());
|
|
48
45
|
}
|
|
49
46
|
registerSchema(scope, context) {
|
|
50
|
-
const scopeStr =
|
|
51
|
-
const uri = new
|
|
47
|
+
const scopeStr = PreferenceScope[scope].toLowerCase();
|
|
48
|
+
const uri = new URI(PREFERENCE_URI_PREFIX + scopeStr);
|
|
52
49
|
this.jsonSchemaData.setSchema(uri, (this.schemaProvider.getJSONSchema(scope)));
|
|
53
50
|
}
|
|
54
51
|
updateInMemoryResources() {
|
|
55
|
-
this.jsonSchemaData.setSchema(this.getSchemaURIForScope(
|
|
56
|
-
this.jsonSchemaData.setSchema(this.getSchemaURIForScope(
|
|
57
|
-
this.jsonSchemaData.setSchema(this.getSchemaURIForScope(
|
|
58
|
-
this.jsonSchemaData.setSchema(this.getSchemaURIForScope(
|
|
52
|
+
this.jsonSchemaData.setSchema(this.getSchemaURIForScope(PreferenceScope.Default), (this.schemaProvider.getJSONSchema(PreferenceScope.Default)));
|
|
53
|
+
this.jsonSchemaData.setSchema(this.getSchemaURIForScope(PreferenceScope.User), this.schemaProvider.getJSONSchema(PreferenceScope.User));
|
|
54
|
+
this.jsonSchemaData.setSchema(this.getSchemaURIForScope(PreferenceScope.Workspace), this.schemaProvider.getJSONSchema(PreferenceScope.Workspace));
|
|
55
|
+
this.jsonSchemaData.setSchema(this.getSchemaURIForScope(PreferenceScope.Folder), this.schemaProvider.getJSONSchema(PreferenceScope.Folder));
|
|
59
56
|
}
|
|
60
57
|
getSchemaURIForScope(scope) {
|
|
61
|
-
return new
|
|
58
|
+
return new URI(PREFERENCE_URI_PREFIX + PreferenceScope[scope].toLowerCase());
|
|
62
59
|
}
|
|
63
60
|
};
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
(0, inversify_1.inject)(core_1.PreferenceSchemaService),
|
|
67
|
-
tslib_1.__metadata("design:type", Object)
|
|
61
|
+
__decorate([
|
|
62
|
+
inject(PreferenceSchemaService)
|
|
68
63
|
], PreferencesJsonSchemaContribution.prototype, "schemaProvider", void 0);
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
tslib_1.__metadata("design:type", core_1.PreferenceConfigurations)
|
|
64
|
+
__decorate([
|
|
65
|
+
inject(PreferenceConfigurations)
|
|
72
66
|
], PreferencesJsonSchemaContribution.prototype, "preferenceConfigurations", void 0);
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
tslib_1.__metadata("design:type", json_schema_store_1.JsonSchemaDataStore)
|
|
67
|
+
__decorate([
|
|
68
|
+
inject(JsonSchemaDataStore)
|
|
76
69
|
], PreferencesJsonSchemaContribution.prototype, "jsonSchemaData", void 0);
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
tslib_1.__metadata("design:type", browser_1.WorkspaceService)
|
|
70
|
+
__decorate([
|
|
71
|
+
inject(WorkspaceService)
|
|
80
72
|
], PreferencesJsonSchemaContribution.prototype, "workspaceService", void 0);
|
|
81
|
-
|
|
82
|
-
|
|
73
|
+
PreferencesJsonSchemaContribution = __decorate([
|
|
74
|
+
injectable()
|
|
83
75
|
], PreferencesJsonSchemaContribution);
|
|
76
|
+
export { PreferencesJsonSchemaContribution };
|
|
84
77
|
//# sourceMappingURL=preferences-json-schema-contribution.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preferences-json-schema-contribution.js","sourceRoot":"","sources":["../../src/browser/preferences-json-schema-contribution.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"preferences-json-schema-contribution.js","sourceRoot":"","sources":["../../src/browser/preferences-json-schema-contribution.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,GAAG,MAAM,4BAA4B,CAAC;AAC7C,OAAO,EAAqD,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AACnI,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACjG,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,QAAQ,MAAM,oCAAoC,CAAC;AAE1D,MAAM,qBAAqB,GAAG,4BAA4B,CAAC;AAC3D,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAG5B,IAAM,iCAAiC,GAAvC,MAAM,iCAAiC;IAAvC;QAcgB,qCAAgC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,uBAAuB,EAAE,EAAE,sBAAsB,CAAC,CAAC;IA2CjI,CAAC;IAzCG,eAAe,CAAC,OAAkC;QAC9C,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACtD,IAA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************************************
|
|
3
2
|
// Copyright (C) 2018 TypeFox and others.
|
|
4
3
|
//
|
|
@@ -14,9 +13,7 @@
|
|
|
14
13
|
//
|
|
15
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
15
|
// *****************************************************************************
|
|
17
|
-
|
|
18
|
-
const tslib_1 = require("tslib");
|
|
19
|
-
const monaco = tslib_1.__importStar(require("@theia/monaco-editor-core"));
|
|
16
|
+
import * as monaco from '@theia/monaco-editor-core';
|
|
20
17
|
monaco.languages.register({
|
|
21
18
|
id: 'jsonc',
|
|
22
19
|
'aliases': [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preferences-monaco-contribution.js","sourceRoot":"","sources":["../../src/browser/preferences-monaco-contribution.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"preferences-monaco-contribution.js","sourceRoot":"","sources":["../../src/browser/preferences-monaco-contribution.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAEhF,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AAEpD,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;IACtB,EAAE,EAAE,OAAO;IACX,SAAS,EAAE;QACP,oBAAoB;KACvB;IACD,WAAW,EAAE;QACT,eAAe;KAClB;CACJ,CAAC,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// *****************************************************************************
|
|
3
2
|
// Copyright (C) 2026 EclipseSource GmbH and others.
|
|
4
3
|
//
|
|
@@ -14,13 +13,11 @@
|
|
|
14
13
|
//
|
|
15
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
15
|
// *****************************************************************************
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const window_launch_args_1 = require("@theia/core/lib/browser/window/window-launch-args");
|
|
23
|
-
const cli_preferences_1 = require("../common/cli-preferences");
|
|
16
|
+
import { __decorate } from "tslib";
|
|
17
|
+
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
18
|
+
import { LaunchArguments } from '@theia/core/lib/common/launch-arguments';
|
|
19
|
+
import { WindowLaunchArgs } from '@theia/core/lib/browser/window/window-launch-args';
|
|
20
|
+
import { CliPreferenceEntry } from '../common/cli-preferences.js';
|
|
24
21
|
/**
|
|
25
22
|
* Re-applies `--session-preference` values on a remote backend that is started for a *forwarded*
|
|
26
23
|
* (second-instance) window.
|
|
@@ -38,17 +35,16 @@ let SessionPreferenceRemoteCliContribution = class SessionPreferenceRemoteCliCon
|
|
|
38
35
|
// Cold-start window: the shared backend already forwards its session preferences.
|
|
39
36
|
return [];
|
|
40
37
|
}
|
|
41
|
-
return
|
|
42
|
-
.parseAll(
|
|
43
|
-
.map(entry =>
|
|
38
|
+
return CliPreferenceEntry
|
|
39
|
+
.parseAll(LaunchArguments.values(forwarded, 'session-preference'))
|
|
40
|
+
.map(entry => CliPreferenceEntry.toArg('session-preference', entry));
|
|
44
41
|
}
|
|
45
42
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
(0, inversify_1.inject)(window_launch_args_1.WindowLaunchArgs),
|
|
49
|
-
tslib_1.__metadata("design:type", Object)
|
|
43
|
+
__decorate([
|
|
44
|
+
inject(WindowLaunchArgs)
|
|
50
45
|
], SessionPreferenceRemoteCliContribution.prototype, "launchArgs", void 0);
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
SessionPreferenceRemoteCliContribution = __decorate([
|
|
47
|
+
injectable()
|
|
53
48
|
], SessionPreferenceRemoteCliContribution);
|
|
49
|
+
export { SessionPreferenceRemoteCliContribution };
|
|
54
50
|
//# sourceMappingURL=session-preference-remote-cli-contribution.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-preference-remote-cli-contribution.js","sourceRoot":"","sources":["../../src/browser/session-preference-remote-cli-contribution.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"session-preference-remote-cli-contribution.js","sourceRoot":"","sources":["../../src/browser/session-preference-remote-cli-contribution.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAElE,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE;;;;;;;;;GASG;AAEI,IAAM,sCAAsC,GAA5C,MAAM,sCAAsC;IAK/C,KAAK,CAAC,gBAAgB;QAClB,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC;QAClD,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC1B,kFAAkF;YAClF,OAAO,EAAE,CAAC;QACd,CAAC;QACD,OAAO,kBAAkB;aACpB,QAAQ,CAAC,eAAe,CAAC,MAAM,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;aACjE,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAAC,KAAK,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC,CAAC;IAC7E,CAAC;CACJ,CAAA;AAZsB;IADlB,MAAM,CAAC,gBAAgB,CAAC;0EACuB;AAHvC,sCAAsC;IADlD,UAAU,EAAE;GACA,sCAAsC,CAelD"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// *****************************************************************************
|
|
3
2
|
// Copyright (C) 2026 EclipseSource GmbH and others.
|
|
4
3
|
//
|
|
@@ -14,12 +13,11 @@
|
|
|
14
13
|
//
|
|
15
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
15
|
// *****************************************************************************
|
|
17
|
-
|
|
18
|
-
const chai_1 = require("chai");
|
|
16
|
+
import { expect } from 'chai';
|
|
19
17
|
const launchArgs = (values) => ({ values, negated: [] });
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class TestContribution extends
|
|
18
|
+
import { CliPreferenceEntry } from '../common/cli-preferences.js';
|
|
19
|
+
import { SessionPreferenceRemoteCliContribution } from './session-preference-remote-cli-contribution.js';
|
|
20
|
+
class TestContribution extends SessionPreferenceRemoteCliContribution {
|
|
23
21
|
set forwardedArgs(args) {
|
|
24
22
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
23
|
this.launchArgs = { getLaunchArgs: () => args };
|
|
@@ -32,19 +30,19 @@ describe('SessionPreferenceRemoteCliContribution#getRemoteCliArgs', () => {
|
|
|
32
30
|
});
|
|
33
31
|
it('returns no args for a cold-start window (no forwarded options)', async () => {
|
|
34
32
|
contribution.forwardedArgs = undefined;
|
|
35
|
-
|
|
33
|
+
expect(await contribution.getRemoteCliArgs()).to.deep.equal([]);
|
|
36
34
|
});
|
|
37
35
|
it('returns no args for a forwarded window without --session-preference', async () => {
|
|
38
36
|
contribution.forwardedArgs = launchArgs({ 'attach-container': ['B'] });
|
|
39
|
-
|
|
37
|
+
expect(await contribution.getRemoteCliArgs()).to.deep.equal([]);
|
|
40
38
|
});
|
|
41
39
|
it('formats forwarded --session-preference values for the remote backend', async () => {
|
|
42
40
|
contribution.forwardedArgs = launchArgs({ 'attach-container': ['B'], 'session-preference': ['editor.fontSize=20'] });
|
|
43
41
|
const args = await contribution.getRemoteCliArgs();
|
|
44
|
-
|
|
42
|
+
expect(args).to.have.lengthOf(1);
|
|
45
43
|
// The produced arg must parse back to the original entry on the remote.
|
|
46
44
|
const value = args[0].substring('--session-preference='.length);
|
|
47
|
-
|
|
45
|
+
expect(CliPreferenceEntry.parse(value)).to.deep.equal({ preferenceName: 'editor.fontSize', value: 20 });
|
|
48
46
|
});
|
|
49
47
|
});
|
|
50
48
|
//# sourceMappingURL=session-preference-remote-cli-contribution.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-preference-remote-cli-contribution.spec.js","sourceRoot":"","sources":["../../src/browser/session-preference-remote-cli-contribution.spec.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"session-preference-remote-cli-contribution.spec.js","sourceRoot":"","sources":["../../src/browser/session-preference-remote-cli-contribution.spec.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAEhF,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAG9B,MAAM,UAAU,GAAG,CAAC,MAAgC,EAAmB,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;AACpG,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,sCAAsC,EAAE,MAAM,iDAAiD,CAAC;AAEzG,MAAM,gBAAiB,SAAQ,sCAAsC;IACjE,IAAI,aAAa,CAAC,IAAiC;QAC/C,8DAA8D;QAC7D,IAAY,CAAC,UAAU,GAAG,EAAE,aAAa,EAAE,GA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