@theia/monaco 1.45.1 → 1.46.0-next.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +100 -100
- package/data/monaco-nls.json +1379 -1379
- package/data/monaco-themes/vscode/dark_plus.json +201 -201
- package/data/monaco-themes/vscode/dark_theia.json +5 -5
- package/data/monaco-themes/vscode/dark_vs.json +393 -393
- package/data/monaco-themes/vscode/hc_black.json +457 -457
- package/data/monaco-themes/vscode/hc_light.json +590 -590
- package/data/monaco-themes/vscode/hc_theia.json +5 -5
- package/data/monaco-themes/vscode/hc_theia_light.json +5 -5
- package/data/monaco-themes/vscode/light_plus.json +202 -202
- package/data/monaco-themes/vscode/light_theia.json +10 -10
- package/data/monaco-themes/vscode/light_vs.json +421 -421
- package/lib/browser/index.d.ts +1 -1
- package/lib/browser/index.js +28 -28
- package/lib/browser/markdown-renderer/monaco-markdown-renderer.d.ts +20 -24
- package/lib/browser/markdown-renderer/monaco-markdown-renderer.d.ts.map +1 -1
- package/lib/browser/markdown-renderer/monaco-markdown-renderer.js +122 -137
- package/lib/browser/markdown-renderer/monaco-markdown-renderer.js.map +1 -1
- package/lib/browser/monaco-bulk-edit-service.d.ts +12 -14
- package/lib/browser/monaco-bulk-edit-service.d.ts.map +1 -1
- package/lib/browser/monaco-bulk-edit-service.js +66 -66
- package/lib/browser/monaco-bulk-edit-service.js.map +1 -1
- package/lib/browser/monaco-color-registry.d.ts +16 -16
- package/lib/browser/monaco-color-registry.js +82 -82
- package/lib/browser/monaco-command-registry.d.ts +19 -19
- package/lib/browser/monaco-command-registry.d.ts.map +1 -1
- package/lib/browser/monaco-command-registry.js +88 -85
- package/lib/browser/monaco-command-registry.js.map +1 -1
- package/lib/browser/monaco-command-service.d.ts +21 -26
- package/lib/browser/monaco-command-service.d.ts.map +1 -1
- package/lib/browser/monaco-command-service.js +93 -92
- package/lib/browser/monaco-command-service.js.map +1 -1
- package/lib/browser/monaco-command.d.ts +88 -94
- package/lib/browser/monaco-command.d.ts.map +1 -1
- package/lib/browser/monaco-command.js +294 -307
- package/lib/browser/monaco-command.js.map +1 -1
- package/lib/browser/monaco-context-key-service.d.ts +22 -22
- package/lib/browser/monaco-context-key-service.d.ts.map +1 -1
- package/lib/browser/monaco-context-key-service.js +146 -147
- package/lib/browser/monaco-context-key-service.js.map +1 -1
- package/lib/browser/monaco-context-menu.d.ts +17 -16
- package/lib/browser/monaco-context-menu.d.ts.map +1 -1
- package/lib/browser/monaco-context-menu.js +112 -102
- package/lib/browser/monaco-context-menu.js.map +1 -1
- package/lib/browser/monaco-diff-editor.d.ts +29 -29
- package/lib/browser/monaco-diff-editor.d.ts.map +1 -1
- package/lib/browser/monaco-diff-editor.js +74 -74
- package/lib/browser/monaco-diff-editor.js.map +1 -1
- package/lib/browser/monaco-diff-navigator-factory.d.ts +6 -7
- package/lib/browser/monaco-diff-navigator-factory.d.ts.map +1 -1
- package/lib/browser/monaco-diff-navigator-factory.js +45 -66
- package/lib/browser/monaco-diff-navigator-factory.js.map +1 -1
- package/lib/browser/monaco-editor-model.d.ts +158 -156
- package/lib/browser/monaco-editor-model.d.ts.map +1 -1
- package/lib/browser/monaco-editor-model.js +562 -559
- package/lib/browser/monaco-editor-model.js.map +1 -1
- package/lib/browser/monaco-editor-provider.d.ts +70 -89
- package/lib/browser/monaco-editor-provider.d.ts.map +1 -1
- package/lib/browser/monaco-editor-provider.js +386 -440
- package/lib/browser/monaco-editor-provider.js.map +1 -1
- package/lib/browser/monaco-editor-service.d.ts +32 -27
- package/lib/browser/monaco-editor-service.d.ts.map +1 -1
- package/lib/browser/monaco-editor-service.js +158 -155
- package/lib/browser/monaco-editor-service.js.map +1 -1
- package/lib/browser/monaco-editor-zone-widget.d.ts +43 -43
- package/lib/browser/monaco-editor-zone-widget.js +194 -194
- package/lib/browser/monaco-editor.d.ts +154 -151
- package/lib/browser/monaco-editor.d.ts.map +1 -1
- package/lib/browser/monaco-editor.js +542 -524
- package/lib/browser/monaco-editor.js.map +1 -1
- package/lib/browser/monaco-formatting-conflicts.d.ts +13 -13
- package/lib/browser/monaco-formatting-conflicts.js +111 -111
- package/lib/browser/monaco-formatting-conflicts.js.map +1 -1
- package/lib/browser/monaco-frontend-application-contribution.d.ts +22 -28
- package/lib/browser/monaco-frontend-application-contribution.d.ts.map +1 -1
- package/lib/browser/monaco-frontend-application-contribution.js +178 -215
- package/lib/browser/monaco-frontend-application-contribution.js.map +1 -1
- package/lib/browser/monaco-frontend-module.d.ts +7 -7
- package/lib/browser/monaco-frontend-module.d.ts.map +1 -1
- package/lib/browser/monaco-frontend-module.js +280 -271
- package/lib/browser/monaco-frontend-module.js.map +1 -1
- package/lib/browser/monaco-gotoline-quick-access.d.ts +11 -11
- package/lib/browser/monaco-gotoline-quick-access.js +64 -64
- package/lib/browser/monaco-gotosymbol-quick-access.d.ts +16 -16
- package/lib/browser/monaco-gotosymbol-quick-access.js +70 -70
- package/lib/browser/monaco-icon-registry.d.ts +10 -11
- package/lib/browser/monaco-icon-registry.d.ts.map +1 -1
- package/lib/browser/monaco-icon-registry.js +52 -50
- package/lib/browser/monaco-icon-registry.js.map +1 -1
- package/lib/browser/monaco-indexed-db.d.ts +28 -28
- package/lib/browser/monaco-indexed-db.js +131 -131
- package/lib/browser/monaco-init.d.ts +5 -0
- package/lib/browser/monaco-init.d.ts.map +1 -0
- package/lib/browser/monaco-init.js +125 -0
- package/lib/browser/monaco-init.js.map +1 -0
- package/lib/browser/monaco-keybinding.d.ts +16 -16
- package/lib/browser/monaco-keybinding.js +134 -134
- package/lib/browser/monaco-keybinding.js.map +1 -1
- package/lib/browser/monaco-keycode-map.d.ts +2 -2
- package/lib/browser/monaco-keycode-map.js +163 -163
- package/lib/browser/monaco-keycode-map.js.map +1 -1
- package/lib/browser/monaco-languages.d.ts +35 -35
- package/lib/browser/monaco-languages.js +180 -180
- package/lib/browser/monaco-marker-collection.d.ts +18 -18
- package/lib/browser/monaco-marker-collection.js +70 -70
- package/lib/browser/monaco-menu.d.ts +20 -20
- package/lib/browser/monaco-menu.js +145 -145
- package/lib/browser/monaco-mime-service.d.ts +10 -10
- package/lib/browser/monaco-mime-service.js +78 -78
- package/lib/browser/monaco-outline-contribution.d.ts +78 -78
- package/lib/browser/monaco-outline-contribution.js +384 -384
- package/lib/browser/monaco-outline-decorator.d.ts +12 -12
- package/lib/browser/monaco-outline-decorator.js +67 -67
- package/lib/browser/monaco-quick-access-registry.d.ts +11 -11
- package/lib/browser/monaco-quick-access-registry.js +99 -99
- package/lib/browser/monaco-quick-input-service.d.ts +99 -101
- package/lib/browser/monaco-quick-input-service.d.ts.map +1 -1
- package/lib/browser/monaco-quick-input-service.js +529 -568
- package/lib/browser/monaco-quick-input-service.js.map +1 -1
- package/lib/browser/monaco-resolved-keybinding.d.ts +23 -23
- package/lib/browser/monaco-resolved-keybinding.d.ts.map +1 -1
- package/lib/browser/monaco-resolved-keybinding.js +131 -131
- package/lib/browser/monaco-resolved-keybinding.js.map +1 -1
- package/lib/browser/monaco-snippet-suggest-provider.d.ts +66 -66
- package/lib/browser/monaco-snippet-suggest-provider.js +273 -273
- package/lib/browser/monaco-status-bar-contribution.d.ts +17 -17
- package/lib/browser/monaco-status-bar-contribution.js +121 -121
- package/lib/browser/monaco-text-model-service.d.ts +51 -51
- package/lib/browser/monaco-text-model-service.js +189 -189
- package/lib/browser/monaco-text-model-service.js.map +1 -1
- package/lib/browser/monaco-theming-service.d.ts +67 -67
- package/lib/browser/monaco-theming-service.js +171 -171
- package/lib/browser/monaco-to-protocol-converter.d.ts +26 -26
- package/lib/browser/monaco-to-protocol-converter.js +61 -61
- package/lib/browser/monaco-workspace.d.ts +83 -85
- package/lib/browser/monaco-workspace.d.ts.map +1 -1
- package/lib/browser/monaco-workspace.js +384 -384
- package/lib/browser/monaco-workspace.js.map +1 -1
- package/lib/browser/protocol-to-monaco-converter.d.ts +31 -31
- package/lib/browser/protocol-to-monaco-converter.js +133 -133
- package/lib/browser/simple-monaco-editor.d.ts +45 -44
- package/lib/browser/simple-monaco-editor.d.ts.map +1 -1
- package/lib/browser/simple-monaco-editor.js +184 -176
- package/lib/browser/simple-monaco-editor.js.map +1 -1
- package/lib/browser/textmate/index.d.ts +4 -4
- package/lib/browser/textmate/index.js +31 -31
- package/lib/browser/textmate/monaco-textmate-frontend-bindings.d.ts +11 -11
- package/lib/browser/textmate/monaco-textmate-frontend-bindings.js +91 -91
- package/lib/browser/textmate/monaco-textmate-service.d.ts +30 -30
- package/lib/browser/textmate/monaco-textmate-service.js +185 -185
- package/lib/browser/textmate/monaco-textmate-service.js.map +1 -1
- package/lib/browser/textmate/monaco-theme-registry.d.ts +27 -27
- package/lib/browser/textmate/monaco-theme-registry.js +173 -173
- package/lib/browser/textmate/monaco-theme-types.d.ts +20 -20
- package/lib/browser/textmate/monaco-theme-types.js +21 -21
- package/lib/browser/textmate/textmate-contribution.d.ts +9 -9
- package/lib/browser/textmate/textmate-contribution.js +27 -27
- package/lib/browser/textmate/textmate-registry.d.ts +31 -31
- package/lib/browser/textmate/textmate-registry.js +109 -109
- package/lib/browser/textmate/textmate-snippet-completion-provider.d.ts +26 -26
- package/lib/browser/textmate/textmate-snippet-completion-provider.js +53 -53
- package/lib/browser/textmate/textmate-tokenizer.d.ts +22 -22
- package/lib/browser/textmate/textmate-tokenizer.js +65 -65
- package/lib/browser/workspace-symbol-command.d.ts +55 -55
- package/lib/browser/workspace-symbol-command.js +215 -215
- package/lib/package.spec.js +25 -25
- package/package.json +10 -10
- package/src/browser/index.ts +17 -17
- package/src/browser/markdown-renderer/monaco-markdown-renderer.ts +109 -117
- package/src/browser/monaco-bulk-edit-service.ts +64 -64
- package/src/browser/monaco-color-registry.ts +73 -73
- package/src/browser/monaco-command-registry.ts +85 -82
- package/src/browser/monaco-command-service.ts +90 -99
- package/src/browser/monaco-command.ts +303 -313
- package/src/browser/monaco-context-key-service.ts +144 -143
- package/src/browser/monaco-context-menu.ts +100 -90
- package/src/browser/monaco-diff-editor.ts +100 -101
- package/src/browser/monaco-diff-navigator-factory.ts +39 -61
- package/src/browser/monaco-editor-model.ts +684 -681
- package/src/browser/monaco-editor-provider.ts +409 -452
- package/src/browser/monaco-editor-service.ts +149 -144
- package/src/browser/monaco-editor-zone-widget.ts +250 -250
- package/src/browser/monaco-editor.ts +663 -644
- package/src/browser/monaco-formatting-conflicts.ts +116 -116
- package/src/browser/monaco-frontend-application-contribution.ts +165 -200
- package/src/browser/monaco-frontend-module.ts +328 -320
- package/src/browser/monaco-gotoline-quick-access.ts +47 -47
- package/src/browser/monaco-gotosymbol-quick-access.ts +53 -53
- package/src/browser/monaco-icon-registry.ts +49 -47
- package/src/browser/monaco-indexed-db.ts +130 -130
- package/src/browser/monaco-init.ts +114 -0
- package/src/browser/monaco-keybinding.ts +111 -111
- package/src/browser/monaco-keycode-map.ts +171 -171
- package/src/browser/monaco-languages.ts +177 -177
- package/src/browser/monaco-marker-collection.ts +83 -83
- package/src/browser/monaco-menu.ts +142 -142
- package/src/browser/monaco-mime-service.ts +71 -71
- package/src/browser/monaco-outline-contribution.ts +404 -404
- package/src/browser/monaco-outline-decorator.ts +66 -66
- package/src/browser/monaco-quick-access-registry.ts +112 -112
- package/src/browser/monaco-quick-input-service.ts +647 -676
- package/src/browser/monaco-resolved-keybinding.ts +162 -162
- package/src/browser/monaco-snippet-suggest-provider.ts +306 -306
- package/src/browser/monaco-status-bar-contribution.ts +110 -110
- package/src/browser/monaco-text-model-service.ts +199 -199
- package/src/browser/monaco-theming-service.ts +204 -204
- package/src/browser/monaco-to-protocol-converter.ts +71 -71
- package/src/browser/monaco-workspace.ts +412 -412
- package/src/browser/protocol-to-monaco-converter.ts +158 -158
- package/src/browser/simple-monaco-editor.ts +217 -210
- package/src/browser/style/index.css +263 -263
- package/src/browser/textmate/index.ts +20 -20
- package/src/browser/textmate/monaco-textmate-frontend-bindings.ts +90 -90
- package/src/browser/textmate/monaco-textmate-service.ts +187 -187
- package/src/browser/textmate/monaco-theme-registry.ts +176 -176
- package/src/browser/textmate/monaco-theme-types.ts +37 -37
- package/src/browser/textmate/textmate-contribution.ts +29 -29
- package/src/browser/textmate/textmate-registry.ts +129 -129
- package/src/browser/textmate/textmate-snippet-completion-provider.ts +73 -73
- package/src/browser/textmate/textmate-tokenizer.ts +84 -84
- package/src/browser/workspace-symbol-command.ts +196 -196
- package/src/package.spec.ts +28 -28
|
@@ -1,320 +1,328 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2018 TypeFox and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import * as MonacoNls from '@theia/monaco-editor-core/esm/vs/nls';
|
|
18
|
-
import { nls } from '@theia/core/lib/common/nls';
|
|
19
|
-
import { FormatType, Localization } from '@theia/core/lib/common/i18n/localization';
|
|
20
|
-
|
|
21
|
-
Object.assign(MonacoNls, {
|
|
22
|
-
localize(_key: string, label: string, ...args: FormatType[]): string {
|
|
23
|
-
if (nls.locale) {
|
|
24
|
-
const defaultKey = nls.getDefaultKey(label);
|
|
25
|
-
if (defaultKey) {
|
|
26
|
-
return nls.localize(defaultKey, label, ...args);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return Localization.format(label, args);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
import '../../src/browser/style/index.css';
|
|
34
|
-
import { ContainerModule,
|
|
35
|
-
import { MenuContribution, CommandContribution, quickInputServicePath } from '@theia/core/lib/common';
|
|
36
|
-
import {
|
|
37
|
-
FrontendApplicationContribution, KeybindingContribution,
|
|
38
|
-
PreferenceService, PreferenceSchemaProvider, createPreferenceProxy,
|
|
39
|
-
PreferenceScope, PreferenceChange, OVERRIDE_PROPERTY_PATTERN, QuickInputService, StylingParticipant, WebSocketConnectionProvider
|
|
40
|
-
} from '@theia/core/lib/browser';
|
|
41
|
-
import { TextEditorProvider, DiffNavigatorProvider, TextEditor } from '@theia/editor/lib/browser';
|
|
42
|
-
import { MonacoEditorProvider, MonacoEditorFactory } from './monaco-editor-provider';
|
|
43
|
-
import { MonacoEditorMenuContribution } from './monaco-menu';
|
|
44
|
-
import { MonacoEditorCommandHandlers } from './monaco-command';
|
|
45
|
-
import { MonacoKeybindingContribution } from './monaco-keybinding';
|
|
46
|
-
import { MonacoLanguages } from './monaco-languages';
|
|
47
|
-
import { MonacoWorkspace } from './monaco-workspace';
|
|
48
|
-
import { MonacoEditorService } from './monaco-editor-service';
|
|
49
|
-
import { MonacoTextModelService, MonacoEditorModelFactory } from './monaco-text-model-service';
|
|
50
|
-
import { MonacoContextMenuService } from './monaco-context-menu';
|
|
51
|
-
import { MonacoOutlineContribution } from './monaco-outline-contribution';
|
|
52
|
-
import { MonacoStatusBarContribution } from './monaco-status-bar-contribution';
|
|
53
|
-
import { MonacoCommandService
|
|
54
|
-
import { MonacoCommandRegistry } from './monaco-command-registry';
|
|
55
|
-
import { MonacoDiffNavigatorFactory } from './monaco-diff-navigator-factory';
|
|
56
|
-
import { MonacoFrontendApplicationContribution } from './monaco-frontend-application-contribution';
|
|
57
|
-
import MonacoTextmateModuleBinder from './textmate/monaco-textmate-frontend-bindings';
|
|
58
|
-
import { MonacoBulkEditService } from './monaco-bulk-edit-service';
|
|
59
|
-
import { MonacoOutlineDecorator } from './monaco-outline-decorator';
|
|
60
|
-
import { OutlineTreeDecorator } from '@theia/outline-view/lib/browser/outline-decorator-service';
|
|
61
|
-
import { MonacoSnippetSuggestProvider } from './monaco-snippet-suggest-provider';
|
|
62
|
-
import { ContextKeyService } from '@theia/core/lib/browser/context-key-service';
|
|
63
|
-
import { MonacoContextKeyService } from './monaco-context-key-service';
|
|
64
|
-
import { MonacoMimeService } from './monaco-mime-service';
|
|
65
|
-
import { MimeService } from '@theia/core/lib/browser/mime-service';
|
|
66
|
-
import { MonacoEditorServices } from './monaco-editor';
|
|
67
|
-
import { MonacoColorRegistry } from './monaco-color-registry';
|
|
68
|
-
import { ColorRegistry } from '@theia/core/lib/browser/color-registry';
|
|
69
|
-
import { MonacoIconRegistry } from './monaco-icon-registry';
|
|
70
|
-
import { IconRegistry } from '@theia/core/lib/browser/icon-registry';
|
|
71
|
-
import { MonacoThemingService } from './monaco-theming-service';
|
|
72
|
-
import { bindContributionProvider } from '@theia/core';
|
|
73
|
-
import { WorkspaceSymbolCommand } from './workspace-symbol-command';
|
|
74
|
-
import { LanguageService } from '@theia/core/lib/browser/language-service';
|
|
75
|
-
import { MonacoToProtocolConverter } from './monaco-to-protocol-converter';
|
|
76
|
-
import { ProtocolToMonacoConverter } from './protocol-to-monaco-converter';
|
|
77
|
-
import { MonacoFormattingConflictsContribution } from './monaco-formatting-conflicts';
|
|
78
|
-
import { MonacoQuickInputImplementation, MonacoQuickInputService } from './monaco-quick-input-service';
|
|
79
|
-
import { GotoLineQuickAccessContribution } from './monaco-gotoline-quick-access';
|
|
80
|
-
import { GotoSymbolQuickAccessContribution } from './monaco-gotosymbol-quick-access';
|
|
81
|
-
import { QuickAccessContribution, QuickAccessRegistry } from '@theia/core/lib/browser/quick-input/quick-access';
|
|
82
|
-
import { MonacoQuickAccessRegistry } from './monaco-quick-access-registry';
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
90
|
-
import {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
bind(
|
|
101
|
-
bind(
|
|
102
|
-
bind(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
bind(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
).
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
bind(MonacoTextModelService).toSelf().inSingletonScope();
|
|
127
|
-
bind(MonacoContextMenuService).toSelf().inSingletonScope();
|
|
128
|
-
bind(MonacoEditorServices).toSelf().inSingletonScope();
|
|
129
|
-
bind(MonacoEditorProvider).toSelf().inSingletonScope();
|
|
130
|
-
bindContributionProvider(bind, MonacoEditorFactory);
|
|
131
|
-
bindContributionProvider(bind, MonacoEditorModelFactory);
|
|
132
|
-
bind(MonacoCommandService).toSelf().inTransientScope();
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
bind(
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
bind(
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
bind(
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
bind(
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
bind(
|
|
156
|
-
bind(
|
|
157
|
-
bind(
|
|
158
|
-
bind(
|
|
159
|
-
bind(
|
|
160
|
-
bind(
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
bind(
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
bind(
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
bind(
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
bind(
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
bind(
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
bind(
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
export
|
|
198
|
-
|
|
199
|
-
const
|
|
200
|
-
const
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
if (
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2018 TypeFox and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import * as MonacoNls from '@theia/monaco-editor-core/esm/vs/nls';
|
|
18
|
+
import { nls } from '@theia/core/lib/common/nls';
|
|
19
|
+
import { FormatType, Localization } from '@theia/core/lib/common/i18n/localization';
|
|
20
|
+
|
|
21
|
+
Object.assign(MonacoNls, {
|
|
22
|
+
localize(_key: string, label: string, ...args: FormatType[]): string {
|
|
23
|
+
if (nls.locale) {
|
|
24
|
+
const defaultKey = nls.getDefaultKey(label);
|
|
25
|
+
if (defaultKey) {
|
|
26
|
+
return nls.localize(defaultKey, label, ...args);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return Localization.format(label, args);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
import '../../src/browser/style/index.css';
|
|
34
|
+
import { ContainerModule, interfaces } from '@theia/core/shared/inversify';
|
|
35
|
+
import { MenuContribution, CommandContribution, quickInputServicePath } from '@theia/core/lib/common';
|
|
36
|
+
import {
|
|
37
|
+
FrontendApplicationContribution, KeybindingContribution,
|
|
38
|
+
PreferenceService, PreferenceSchemaProvider, createPreferenceProxy,
|
|
39
|
+
PreferenceScope, PreferenceChange, OVERRIDE_PROPERTY_PATTERN, QuickInputService, StylingParticipant, WebSocketConnectionProvider
|
|
40
|
+
} from '@theia/core/lib/browser';
|
|
41
|
+
import { TextEditorProvider, DiffNavigatorProvider, TextEditor } from '@theia/editor/lib/browser';
|
|
42
|
+
import { MonacoEditorProvider, MonacoEditorFactory } from './monaco-editor-provider';
|
|
43
|
+
import { MonacoEditorMenuContribution } from './monaco-menu';
|
|
44
|
+
import { MonacoEditorCommandHandlers } from './monaco-command';
|
|
45
|
+
import { MonacoKeybindingContribution } from './monaco-keybinding';
|
|
46
|
+
import { MonacoLanguages } from './monaco-languages';
|
|
47
|
+
import { MonacoWorkspace } from './monaco-workspace';
|
|
48
|
+
import { MonacoEditorService, MonacoEditorServiceFactory, VSCodeContextKeyService, VSCodeThemeService } from './monaco-editor-service';
|
|
49
|
+
import { MonacoTextModelService, MonacoEditorModelFactory } from './monaco-text-model-service';
|
|
50
|
+
import { MonacoContextMenuService } from './monaco-context-menu';
|
|
51
|
+
import { MonacoOutlineContribution } from './monaco-outline-contribution';
|
|
52
|
+
import { MonacoStatusBarContribution } from './monaco-status-bar-contribution';
|
|
53
|
+
import { MonacoCommandService } from './monaco-command-service';
|
|
54
|
+
import { MonacoCommandRegistry } from './monaco-command-registry';
|
|
55
|
+
import { MonacoDiffNavigatorFactory } from './monaco-diff-navigator-factory';
|
|
56
|
+
import { MonacoFrontendApplicationContribution } from './monaco-frontend-application-contribution';
|
|
57
|
+
import MonacoTextmateModuleBinder from './textmate/monaco-textmate-frontend-bindings';
|
|
58
|
+
import { MonacoBulkEditService } from './monaco-bulk-edit-service';
|
|
59
|
+
import { MonacoOutlineDecorator } from './monaco-outline-decorator';
|
|
60
|
+
import { OutlineTreeDecorator } from '@theia/outline-view/lib/browser/outline-decorator-service';
|
|
61
|
+
import { MonacoSnippetSuggestProvider } from './monaco-snippet-suggest-provider';
|
|
62
|
+
import { ContextKeyService } from '@theia/core/lib/browser/context-key-service';
|
|
63
|
+
import { MonacoContextKeyService } from './monaco-context-key-service';
|
|
64
|
+
import { MonacoMimeService } from './monaco-mime-service';
|
|
65
|
+
import { MimeService } from '@theia/core/lib/browser/mime-service';
|
|
66
|
+
import { MonacoEditorServices } from './monaco-editor';
|
|
67
|
+
import { MonacoColorRegistry } from './monaco-color-registry';
|
|
68
|
+
import { ColorRegistry } from '@theia/core/lib/browser/color-registry';
|
|
69
|
+
import { MonacoIconRegistry } from './monaco-icon-registry';
|
|
70
|
+
import { IconRegistry } from '@theia/core/lib/browser/icon-registry';
|
|
71
|
+
import { MonacoThemingService } from './monaco-theming-service';
|
|
72
|
+
import { bindContributionProvider } from '@theia/core';
|
|
73
|
+
import { WorkspaceSymbolCommand } from './workspace-symbol-command';
|
|
74
|
+
import { LanguageService } from '@theia/core/lib/browser/language-service';
|
|
75
|
+
import { MonacoToProtocolConverter } from './monaco-to-protocol-converter';
|
|
76
|
+
import { ProtocolToMonacoConverter } from './protocol-to-monaco-converter';
|
|
77
|
+
import { MonacoFormattingConflictsContribution } from './monaco-formatting-conflicts';
|
|
78
|
+
import { MonacoQuickInputImplementation, MonacoQuickInputService } from './monaco-quick-input-service';
|
|
79
|
+
import { GotoLineQuickAccessContribution } from './monaco-gotoline-quick-access';
|
|
80
|
+
import { GotoSymbolQuickAccessContribution } from './monaco-gotosymbol-quick-access';
|
|
81
|
+
import { QuickAccessContribution, QuickAccessRegistry } from '@theia/core/lib/browser/quick-input/quick-access';
|
|
82
|
+
import { MonacoQuickAccessRegistry } from './monaco-quick-access-registry';
|
|
83
|
+
import { ConfigurationTarget, IConfigurationChangeEvent, IConfigurationService } from '@theia/monaco-editor-core/esm/vs/platform/configuration/common/configuration';
|
|
84
|
+
import { StandaloneConfigurationService } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices';
|
|
85
|
+
import { Configuration } from '@theia/monaco-editor-core/esm/vs/platform/configuration/common/configurationModels';
|
|
86
|
+
import { MarkdownRenderer } from '@theia/core/lib/browser/markdown-rendering/markdown-renderer';
|
|
87
|
+
import { MonacoMarkdownRenderer } from './markdown-renderer/monaco-markdown-renderer';
|
|
88
|
+
import { ThemeService } from '@theia/core/lib/browser/theming';
|
|
89
|
+
import { ThemeServiceWithDB } from './monaco-indexed-db';
|
|
90
|
+
import { IContextKeyService } from '@theia/monaco-editor-core/esm/vs/platform/contextkey/common/contextkey';
|
|
91
|
+
import { IThemeService } from '@theia/monaco-editor-core/esm/vs/platform/theme/common/themeService';
|
|
92
|
+
|
|
93
|
+
export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
94
|
+
bind(MonacoThemingService).toSelf().inSingletonScope();
|
|
95
|
+
|
|
96
|
+
bind(MonacoContextKeyService).toSelf().inSingletonScope();
|
|
97
|
+
rebind(ContextKeyService).toService(MonacoContextKeyService);
|
|
98
|
+
|
|
99
|
+
bind(MonacoSnippetSuggestProvider).toSelf().inSingletonScope();
|
|
100
|
+
bind(MonacoFrontendApplicationContribution).toSelf().inSingletonScope();
|
|
101
|
+
bind(FrontendApplicationContribution).toService(MonacoFrontendApplicationContribution);
|
|
102
|
+
bind(StylingParticipant).toService(MonacoFrontendApplicationContribution);
|
|
103
|
+
|
|
104
|
+
bind(MonacoToProtocolConverter).toSelf().inSingletonScope();
|
|
105
|
+
bind(ProtocolToMonacoConverter).toSelf().inSingletonScope();
|
|
106
|
+
|
|
107
|
+
bind(MonacoLanguages).toSelf().inSingletonScope();
|
|
108
|
+
rebind(LanguageService).toService(MonacoLanguages);
|
|
109
|
+
bind(WorkspaceSymbolCommand).toSelf().inSingletonScope();
|
|
110
|
+
for (const identifier of [CommandContribution, KeybindingContribution, MenuContribution, QuickAccessContribution]) {
|
|
111
|
+
bind(identifier).toService(WorkspaceSymbolCommand);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
bind(MonacoWorkspace).toSelf().inSingletonScope();
|
|
115
|
+
|
|
116
|
+
bind(MonacoConfigurationService).toDynamicValue(({ container }) => createMonacoConfigurationService(container)).inSingletonScope();
|
|
117
|
+
|
|
118
|
+
bind(MonacoBulkEditService).toSelf().inSingletonScope();
|
|
119
|
+
bind(MonacoEditorServiceFactory).toFactory((context: interfaces.Context) => (contextKeyService: IContextKeyService, themeService: IThemeService) => {
|
|
120
|
+
const child = context.container.createChild();
|
|
121
|
+
child.bind(VSCodeContextKeyService).toConstantValue(contextKeyService);
|
|
122
|
+
child.bind(VSCodeThemeService).toConstantValue(themeService);
|
|
123
|
+
child.bind(MonacoEditorService).toSelf().inSingletonScope();
|
|
124
|
+
return child.get(MonacoEditorService);
|
|
125
|
+
});
|
|
126
|
+
bind(MonacoTextModelService).toSelf().inSingletonScope();
|
|
127
|
+
bind(MonacoContextMenuService).toSelf().inSingletonScope();
|
|
128
|
+
bind(MonacoEditorServices).toSelf().inSingletonScope();
|
|
129
|
+
bind(MonacoEditorProvider).toSelf().inSingletonScope();
|
|
130
|
+
bindContributionProvider(bind, MonacoEditorFactory);
|
|
131
|
+
bindContributionProvider(bind, MonacoEditorModelFactory);
|
|
132
|
+
bind(MonacoCommandService).toSelf().inTransientScope();
|
|
133
|
+
|
|
134
|
+
bind(TextEditorProvider).toProvider(context =>
|
|
135
|
+
uri => context.container.get(MonacoEditorProvider).get(uri)
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
bind(MonacoDiffNavigatorFactory).toSelf().inSingletonScope();
|
|
139
|
+
bind(DiffNavigatorProvider).toFactory(context =>
|
|
140
|
+
(editor: TextEditor) => context.container.get(MonacoEditorProvider).getDiffNavigator(editor)
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
bind(MonacoOutlineContribution).toSelf().inSingletonScope();
|
|
144
|
+
bind(FrontendApplicationContribution).toService(MonacoOutlineContribution);
|
|
145
|
+
|
|
146
|
+
rebind(MarkdownRenderer).to(MonacoMarkdownRenderer).inSingletonScope();
|
|
147
|
+
|
|
148
|
+
bind(MonacoFormattingConflictsContribution).toSelf().inSingletonScope();
|
|
149
|
+
bind(FrontendApplicationContribution).toService(MonacoFormattingConflictsContribution);
|
|
150
|
+
|
|
151
|
+
bind(MonacoStatusBarContribution).toSelf().inSingletonScope();
|
|
152
|
+
bind(FrontendApplicationContribution).toService(MonacoStatusBarContribution);
|
|
153
|
+
|
|
154
|
+
bind(MonacoCommandRegistry).toSelf().inSingletonScope();
|
|
155
|
+
bind(MonacoEditorCommandHandlers).toSelf().inSingletonScope();
|
|
156
|
+
bind(CommandContribution).toService(MonacoEditorCommandHandlers);
|
|
157
|
+
bind(MonacoEditorMenuContribution).toSelf().inSingletonScope();
|
|
158
|
+
bind(MenuContribution).toService(MonacoEditorMenuContribution);
|
|
159
|
+
bind(MonacoKeybindingContribution).toSelf().inSingletonScope();
|
|
160
|
+
bind(KeybindingContribution).toService(MonacoKeybindingContribution);
|
|
161
|
+
|
|
162
|
+
bind(MonacoQuickInputImplementation).toSelf().inSingletonScope();
|
|
163
|
+
bind(MonacoQuickInputService).toSelf().inSingletonScope().onActivation(({ container }, quickInputService: MonacoQuickInputService) => {
|
|
164
|
+
WebSocketConnectionProvider.createHandler(container, quickInputServicePath, quickInputService);
|
|
165
|
+
return quickInputService;
|
|
166
|
+
});
|
|
167
|
+
bind(QuickInputService).toService(MonacoQuickInputService);
|
|
168
|
+
|
|
169
|
+
bind(MonacoQuickAccessRegistry).toSelf().inSingletonScope();
|
|
170
|
+
bind(QuickAccessRegistry).toService(MonacoQuickAccessRegistry);
|
|
171
|
+
|
|
172
|
+
bind(GotoLineQuickAccessContribution).toSelf().inSingletonScope();
|
|
173
|
+
bind(QuickAccessContribution).toService(GotoLineQuickAccessContribution);
|
|
174
|
+
|
|
175
|
+
bind(GotoSymbolQuickAccessContribution).toSelf().inSingletonScope();
|
|
176
|
+
bind(QuickAccessContribution).toService(GotoSymbolQuickAccessContribution);
|
|
177
|
+
|
|
178
|
+
MonacoTextmateModuleBinder(bind, unbind, isBound, rebind);
|
|
179
|
+
|
|
180
|
+
bind(MonacoOutlineDecorator).toSelf().inSingletonScope();
|
|
181
|
+
bind(OutlineTreeDecorator).toService(MonacoOutlineDecorator);
|
|
182
|
+
|
|
183
|
+
bind(MonacoMimeService).toSelf().inSingletonScope();
|
|
184
|
+
rebind(MimeService).toService(MonacoMimeService);
|
|
185
|
+
|
|
186
|
+
bind(MonacoColorRegistry).toSelf().inSingletonScope();
|
|
187
|
+
rebind(ColorRegistry).toService(MonacoColorRegistry);
|
|
188
|
+
|
|
189
|
+
bind(ThemeServiceWithDB).toSelf().inSingletonScope();
|
|
190
|
+
rebind(ThemeService).toService(ThemeServiceWithDB);
|
|
191
|
+
|
|
192
|
+
bind(MonacoIconRegistry).toSelf().inSingletonScope();
|
|
193
|
+
bind(IconRegistry).toService(MonacoIconRegistry);
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
export const MonacoConfigurationService = Symbol('MonacoConfigurationService');
|
|
197
|
+
export function createMonacoConfigurationService(container: interfaces.Container): IConfigurationService {
|
|
198
|
+
const preferences = container.get<PreferenceService>(PreferenceService);
|
|
199
|
+
const preferenceSchemaProvider = container.get<PreferenceSchemaProvider>(PreferenceSchemaProvider);
|
|
200
|
+
const service = new StandaloneConfigurationService();
|
|
201
|
+
const _configuration: Configuration = service['_configuration'];
|
|
202
|
+
|
|
203
|
+
_configuration.getValue = (section, overrides) => {
|
|
204
|
+
const overrideIdentifier: string | undefined = (overrides && 'overrideIdentifier' in overrides && typeof overrides.overrideIdentifier === 'string')
|
|
205
|
+
? overrides['overrideIdentifier']
|
|
206
|
+
: undefined;
|
|
207
|
+
const resourceUri: string | undefined = (overrides && 'resource' in overrides && !!overrides['resource']) ? overrides['resource'].toString() : undefined;
|
|
208
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
209
|
+
const proxy = createPreferenceProxy<{ [key: string]: any }>(preferences, preferenceSchemaProvider.getCombinedSchema(), {
|
|
210
|
+
resourceUri, overrideIdentifier, style: 'both'
|
|
211
|
+
});
|
|
212
|
+
if (section) {
|
|
213
|
+
return proxy[section];
|
|
214
|
+
}
|
|
215
|
+
return proxy;
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
/*
|
|
219
|
+
* Since we never read values from the underlying service, writing to it doesn't make sense. The standalone editor writes to the configuration when being created,
|
|
220
|
+
* which makes sense in the standalone case where there is no preference infrastructure in place. Those writes degrade the performance, however, so we patch the
|
|
221
|
+
* service to an empty implementation.
|
|
222
|
+
*/
|
|
223
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
224
|
+
service.updateValues = (values: [string, any][]) => Promise.resolve();
|
|
225
|
+
|
|
226
|
+
const toTarget = (scope: PreferenceScope): ConfigurationTarget => {
|
|
227
|
+
switch (scope) {
|
|
228
|
+
case PreferenceScope.Default: return ConfigurationTarget.DEFAULT;
|
|
229
|
+
case PreferenceScope.User: return ConfigurationTarget.USER;
|
|
230
|
+
case PreferenceScope.Workspace: return ConfigurationTarget.WORKSPACE;
|
|
231
|
+
case PreferenceScope.Folder: return ConfigurationTarget.WORKSPACE_FOLDER;
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
interface FireDidChangeConfigurationContext {
|
|
236
|
+
changes: PreferenceChange[];
|
|
237
|
+
affectedKeys: Set<string>;
|
|
238
|
+
keys: Set<string>;
|
|
239
|
+
overrides: Map<string, Set<string>>
|
|
240
|
+
}
|
|
241
|
+
const newFireDidChangeConfigurationContext = (): FireDidChangeConfigurationContext => ({
|
|
242
|
+
changes: [],
|
|
243
|
+
affectedKeys: new Set<string>(),
|
|
244
|
+
keys: new Set<string>(),
|
|
245
|
+
overrides: new Map<string, Set<string>>()
|
|
246
|
+
});
|
|
247
|
+
const fireDidChangeConfiguration = (source: ConfigurationTarget, context: FireDidChangeConfigurationContext): void => {
|
|
248
|
+
if (!context.affectedKeys.size) {
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
const overrides: [string, string[]][] = [];
|
|
252
|
+
for (const [override, values] of context.overrides) {
|
|
253
|
+
overrides.push([override, [...values]]);
|
|
254
|
+
}
|
|
255
|
+
service['_onDidChangeConfiguration'].fire(<IConfigurationChangeEvent>{
|
|
256
|
+
sourceConfig: {},
|
|
257
|
+
change: {
|
|
258
|
+
keys: [...context.keys],
|
|
259
|
+
overrides
|
|
260
|
+
},
|
|
261
|
+
affectedKeys: context.affectedKeys,
|
|
262
|
+
source,
|
|
263
|
+
affectsConfiguration: (prefix, options) => {
|
|
264
|
+
if (!context.affectedKeys.has(prefix)) {
|
|
265
|
+
return false;
|
|
266
|
+
}
|
|
267
|
+
for (const change of context.changes) {
|
|
268
|
+
const overridden = preferences.overriddenPreferenceName(change.preferenceName);
|
|
269
|
+
const preferenceName = overridden ? overridden.preferenceName : change.preferenceName;
|
|
270
|
+
if (preferenceName.startsWith(prefix)) {
|
|
271
|
+
if (options?.overrideIdentifier !== undefined) {
|
|
272
|
+
if (overridden && overridden.overrideIdentifier !== options?.overrideIdentifier) {
|
|
273
|
+
continue;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
if (change.affects(options?.resource?.toString())) {
|
|
277
|
+
return true;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
return false;
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
preferences.onPreferencesChanged(event => {
|
|
287
|
+
let source: ConfigurationTarget | undefined;
|
|
288
|
+
let context = newFireDidChangeConfigurationContext();
|
|
289
|
+
for (let key of Object.keys(event)) {
|
|
290
|
+
const change = event[key];
|
|
291
|
+
const target = toTarget(change.scope);
|
|
292
|
+
if (source !== undefined && target !== source) {
|
|
293
|
+
fireDidChangeConfiguration(source, context);
|
|
294
|
+
context = newFireDidChangeConfigurationContext();
|
|
295
|
+
}
|
|
296
|
+
context.changes.push(change);
|
|
297
|
+
source = target;
|
|
298
|
+
|
|
299
|
+
let overrideKeys: Set<string> | undefined;
|
|
300
|
+
if (key.startsWith('[')) {
|
|
301
|
+
const index = key.indexOf('.');
|
|
302
|
+
const override = key.substring(0, index);
|
|
303
|
+
const overrideIdentifier = override.match(OVERRIDE_PROPERTY_PATTERN)?.[1];
|
|
304
|
+
if (overrideIdentifier) {
|
|
305
|
+
context.keys.add(override);
|
|
306
|
+
context.affectedKeys.add(override);
|
|
307
|
+
overrideKeys = context.overrides.get(overrideIdentifier) || new Set<string>();
|
|
308
|
+
context.overrides.set(overrideIdentifier, overrideKeys);
|
|
309
|
+
key = key.substring(index + 1);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
while (key) {
|
|
313
|
+
if (overrideKeys) {
|
|
314
|
+
overrideKeys.add(key);
|
|
315
|
+
}
|
|
316
|
+
context.keys.add(key);
|
|
317
|
+
context.affectedKeys.add(key);
|
|
318
|
+
const index = key.lastIndexOf('.');
|
|
319
|
+
key = key.substring(0, index);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
if (source) {
|
|
323
|
+
fireDidChangeConfiguration(source, context);
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
return service;
|
|
328
|
+
}
|