@codingame/monaco-vscode-view-common-service-override 21.3.1 → 21.3.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/index.js +1 -0
- package/package.json +41 -41
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.js +7 -7
- package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.js +8 -8
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +29 -29
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +14 -14
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorAccessibilityHelp.js +5 -5
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +13 -13
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +3 -3
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +11 -11
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +5 -5
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.js +12 -12
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/scrollLocking/browser/scrollLocking.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/scrollLocking/browser/scrollLocking.contribution.js +6 -0
- package/vscode/src/vs/workbench/contrib/scrollLocking/browser/scrollLocking.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/scrollLocking/browser/scrollLocking.js +195 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +10 -10
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +5 -5
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +3 -3
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +1 -1
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +5 -5
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +1 -1
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +9 -9
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +9 -9
- package/vscode/src/vs/workbench/services/progress/browser/progressService.js +8 -8
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +5 -5
package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js
CHANGED
|
@@ -155,8 +155,8 @@ let InputCodeEditorView = class InputCodeEditorView extends CodeEditorView {
|
|
|
155
155
|
}
|
|
156
156
|
this.editor.setModel(this.inputNumber === 1 ? vm.model.input1.textModel : vm.model.input2.textModel);
|
|
157
157
|
const title = this.inputNumber === 1
|
|
158
|
-
? vm.model.input1.title || ( localize(
|
|
159
|
-
: vm.model.input2.title || ( localize(
|
|
158
|
+
? vm.model.input1.title || ( localize(8655, 'Input 1'))
|
|
159
|
+
: vm.model.input2.title || ( localize(8656, 'Input 2'));
|
|
160
160
|
const description = this.inputNumber === 1
|
|
161
161
|
? vm.model.input1.description
|
|
162
162
|
: vm.model.input2.description;
|
|
@@ -238,19 +238,19 @@ class ModifiedBaseRangeGutterItemModel {
|
|
|
238
238
|
const both = state.includesInput1 && state.includesInput2;
|
|
239
239
|
return [
|
|
240
240
|
this.baseRange.input1Diffs.length > 0
|
|
241
|
-
? action('mergeEditor.acceptInput1', ( localize(
|
|
241
|
+
? action('mergeEditor.acceptInput1', ( localize(8657, 'Accept {0}', this.model.input1.title)), state.toggle(1), state.includesInput1)
|
|
242
242
|
: undefined,
|
|
243
243
|
this.baseRange.input2Diffs.length > 0
|
|
244
|
-
? action('mergeEditor.acceptInput2', ( localize(
|
|
244
|
+
? action('mergeEditor.acceptInput2', ( localize(8657, 'Accept {0}', this.model.input2.title)), state.toggle(2), state.includesInput2)
|
|
245
245
|
: undefined,
|
|
246
246
|
this.baseRange.isConflicting
|
|
247
|
-
? setFields(action('mergeEditor.acceptBoth', ( localize(
|
|
247
|
+
? setFields(action('mergeEditor.acceptBoth', ( localize(8658, 'Accept Both')), state.withInputValue(1, !both).withInputValue(2, !both), both), { enabled: this.baseRange.canBeCombined })
|
|
248
248
|
: undefined,
|
|
249
249
|
( new Separator()),
|
|
250
250
|
this.baseRange.isConflicting
|
|
251
|
-
? setFields(action('mergeEditor.swap', ( localize(
|
|
251
|
+
? setFields(action('mergeEditor.swap', ( localize(8659, 'Swap')), state.swap(), false), { enabled: !state.kind && (!both || this.baseRange.isOrderRelevant) })
|
|
252
252
|
: undefined,
|
|
253
|
-
setFields(( new Action('mergeEditor.markAsHandled', ( localize(
|
|
253
|
+
setFields(( new Action('mergeEditor.markAsHandled', ( localize(8660, 'Mark as Handled')), undefined, true, () => {
|
|
254
254
|
transaction((tx) => {
|
|
255
255
|
this.model.setHandled(this.baseRange, !handled, tx);
|
|
256
256
|
});
|
|
@@ -293,10 +293,10 @@ class MergeConflictGutterItemView extends Disposable {
|
|
|
293
293
|
const item = this.item.read(reader);
|
|
294
294
|
const value = item.toggleState.read(reader);
|
|
295
295
|
const iconMap = {
|
|
296
|
-
[InputState.excluded]: { icon: undefined, checked: false, title: ( localize(
|
|
297
|
-
[InputState.unrecognized]: { icon: Codicon.circleFilled, checked: false, title: ( localize(
|
|
298
|
-
[InputState.first]: { icon: Codicon.check, checked: true, title: ( localize(
|
|
299
|
-
[InputState.second]: { icon: Codicon.checkAll, checked: true, title: ( localize(
|
|
296
|
+
[InputState.excluded]: { icon: undefined, checked: false, title: ( localize(8661, "Accept")) },
|
|
297
|
+
[InputState.unrecognized]: { icon: Codicon.circleFilled, checked: false, title: ( localize(8662, "Accept (result is dirty)")) },
|
|
298
|
+
[InputState.first]: { icon: Codicon.check, checked: true, title: ( localize(8663, "Undo accept")) },
|
|
299
|
+
[InputState.second]: { icon: Codicon.checkAll, checked: true, title: ( localize(8664, "Undo accept (currently second)")) },
|
|
300
300
|
};
|
|
301
301
|
const state = iconMap[value];
|
|
302
302
|
checkBox.setIcon(state.icon);
|
package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js
CHANGED
|
@@ -131,7 +131,7 @@ let ResultCodeEditorView = class ResultCodeEditorView extends CodeEditorView {
|
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
133
|
this.editor.setModel(vm.model.resultTextModel);
|
|
134
|
-
reset(this.htmlElements.title, ...renderLabelWithIcons(( localize(
|
|
134
|
+
reset(this.htmlElements.title, ...renderLabelWithIcons(( localize(8665, 'Result'))));
|
|
135
135
|
reset(this.htmlElements.description, ...renderLabelWithIcons(this._labelService.getUriLabel(vm.model.resultTextModel.uri, { relative: true })));
|
|
136
136
|
}));
|
|
137
137
|
const remainingConflictsActionBar = this._register(( new ActionBar(this.htmlElements.detail)));
|
|
@@ -146,8 +146,8 @@ let ResultCodeEditorView = class ResultCodeEditorView extends CodeEditorView {
|
|
|
146
146
|
}
|
|
147
147
|
const count = model.unhandledConflictsCount.read(reader);
|
|
148
148
|
const text = count === 1
|
|
149
|
-
? ( localize(
|
|
150
|
-
: ( localize(
|
|
149
|
+
? ( localize(8666, '{0} Conflict Remaining', count))
|
|
150
|
+
: ( localize(8667, '{0} Conflicts Remaining ', count));
|
|
151
151
|
remainingConflictsActionBar.clear();
|
|
152
152
|
remainingConflictsActionBar.push({
|
|
153
153
|
class: undefined,
|
|
@@ -159,8 +159,8 @@ let ResultCodeEditorView = class ResultCodeEditorView extends CodeEditorView {
|
|
|
159
159
|
vm.goToNextModifiedBaseRange(m => !model.isHandled(m).get());
|
|
160
160
|
},
|
|
161
161
|
tooltip: count > 0
|
|
162
|
-
? ( localize(
|
|
163
|
-
: ( localize(
|
|
162
|
+
? ( localize(8668, 'Go to next conflict'))
|
|
163
|
+
: ( localize(8669, 'All conflicts handled, the merge can be completed now.')),
|
|
164
164
|
});
|
|
165
165
|
}));
|
|
166
166
|
this._register(applyObservableDecorations(this.editor, this.decorations));
|
|
@@ -118,7 +118,7 @@ let MergeEditor = class MergeEditor extends AbstractTextEditor {
|
|
|
118
118
|
if (this.input) {
|
|
119
119
|
return this.input.getName();
|
|
120
120
|
}
|
|
121
|
-
return localize(
|
|
121
|
+
return localize(8670, "Text Merge Editor");
|
|
122
122
|
}
|
|
123
123
|
createEditorControl(parent, initialOptions) {
|
|
124
124
|
this.rootHtmlElement = parent;
|
|
@@ -222,7 +222,7 @@ let MergeEditorViewModel = class MergeEditorViewModel extends Disposable {
|
|
|
222
222
|
toggleActiveConflict(inputNumber) {
|
|
223
223
|
const activeModifiedBaseRange = this.activeModifiedBaseRange.get();
|
|
224
224
|
if (!activeModifiedBaseRange) {
|
|
225
|
-
this.notificationService.error(( localize(
|
|
225
|
+
this.notificationService.error(( localize(8671, "There is currently no conflict focused that can be toggled.")));
|
|
226
226
|
return;
|
|
227
227
|
}
|
|
228
228
|
transaction(tx => {
|
|
@@ -24,11 +24,11 @@ let KeyboardLayoutPickerContribution = class KeyboardLayoutPickerContribution ex
|
|
|
24
24
|
this.keyboardLayoutService = keyboardLayoutService;
|
|
25
25
|
this.statusbarService = statusbarService;
|
|
26
26
|
this.pickerElement = this._register(( new MutableDisposable()));
|
|
27
|
-
const name = ( localize(
|
|
27
|
+
const name = ( localize(9357, "Keyboard Layout"));
|
|
28
28
|
const layout = this.keyboardLayoutService.getCurrentKeyboardLayout();
|
|
29
29
|
if (layout) {
|
|
30
30
|
const layoutInfo = parseKeyboardLayoutDescription(layout);
|
|
31
|
-
const text = ( localize(
|
|
31
|
+
const text = ( localize(9358, "Layout: {0}", layoutInfo.label));
|
|
32
32
|
this.pickerElement.value = this.statusbarService.addEntry({
|
|
33
33
|
name,
|
|
34
34
|
text,
|
|
@@ -40,7 +40,7 @@ let KeyboardLayoutPickerContribution = class KeyboardLayoutPickerContribution ex
|
|
|
40
40
|
const layout = this.keyboardLayoutService.getCurrentKeyboardLayout();
|
|
41
41
|
const layoutInfo = parseKeyboardLayoutDescription(layout);
|
|
42
42
|
if (this.pickerElement.value) {
|
|
43
|
-
const text = ( localize(
|
|
43
|
+
const text = ( localize(9358, "Layout: {0}", layoutInfo.label));
|
|
44
44
|
this.pickerElement.value.update({
|
|
45
45
|
name,
|
|
46
46
|
text,
|
|
@@ -49,7 +49,7 @@ let KeyboardLayoutPickerContribution = class KeyboardLayoutPickerContribution ex
|
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
else {
|
|
52
|
-
const text = ( localize(
|
|
52
|
+
const text = ( localize(9358, "Layout: {0}", layoutInfo.label));
|
|
53
53
|
this.pickerElement.value = this.statusbarService.addEntry({
|
|
54
54
|
name,
|
|
55
55
|
text,
|
|
@@ -67,11 +67,11 @@ KeyboardLayoutPickerContribution = ( __decorate([
|
|
|
67
67
|
registerWorkbenchContribution2(KeyboardLayoutPickerContribution.ID, KeyboardLayoutPickerContribution, WorkbenchPhase.BlockStartup);
|
|
68
68
|
const DEFAULT_CONTENT = [
|
|
69
69
|
`// ${( localize(
|
|
70
|
-
|
|
70
|
+
9359,
|
|
71
71
|
'Defines the keyboard layout used in VS Code in the browser environment.'
|
|
72
72
|
))}`,
|
|
73
73
|
`// ${( localize(
|
|
74
|
-
|
|
74
|
+
9360,
|
|
75
75
|
'Open VS Code and run "Developer: Inspect Key Mappings (JSON)" from Command Palette.'
|
|
76
76
|
))}`,
|
|
77
77
|
``,
|
|
@@ -82,7 +82,7 @@ registerAction2(class extends Action2 {
|
|
|
82
82
|
constructor() {
|
|
83
83
|
super({
|
|
84
84
|
id: KEYBOARD_LAYOUT_OPEN_PICKER,
|
|
85
|
-
title: ( localize2(
|
|
85
|
+
title: ( localize2(9361, "Change Keyboard Layout")),
|
|
86
86
|
f1: true
|
|
87
87
|
});
|
|
88
88
|
}
|
|
@@ -112,17 +112,17 @@ registerAction2(class extends Action2 {
|
|
|
112
112
|
});
|
|
113
113
|
if (picks.length > 0) {
|
|
114
114
|
const platform = isMacintosh ? 'Mac' : isWindows ? 'Win' : 'Linux';
|
|
115
|
-
picks.unshift({ type: 'separator', label: ( localize(
|
|
115
|
+
picks.unshift({ type: 'separator', label: ( localize(9362, "Keyboard Layouts ({0})", platform)) });
|
|
116
116
|
}
|
|
117
|
-
const configureKeyboardLayout = { label: ( localize(
|
|
117
|
+
const configureKeyboardLayout = { label: ( localize(9363, "Configure Keyboard Layout")) };
|
|
118
118
|
picks.unshift(configureKeyboardLayout);
|
|
119
119
|
const autoDetectMode = {
|
|
120
|
-
label: ( localize(
|
|
120
|
+
label: ( localize(9364, "Auto Detect")),
|
|
121
121
|
description: isAutoDetect ? `Current: ${parseKeyboardLayoutDescription(currentLayout).label}` : undefined,
|
|
122
122
|
picked: isAutoDetect ? true : undefined
|
|
123
123
|
};
|
|
124
124
|
picks.unshift(autoDetectMode);
|
|
125
|
-
const pick = await quickInputService.pick(picks, { placeHolder: ( localize(
|
|
125
|
+
const pick = await quickInputService.pick(picks, { placeHolder: ( localize(9365, "Select Keyboard Layout")), matchOnDescription: true });
|
|
126
126
|
if (!pick) {
|
|
127
127
|
return;
|
|
128
128
|
}
|
|
@@ -144,7 +144,7 @@ registerAction2(class extends Action2 {
|
|
|
144
144
|
options: { pinned: true }
|
|
145
145
|
});
|
|
146
146
|
}, (error) => {
|
|
147
|
-
throw ( new Error(( localize(
|
|
147
|
+
throw ( new Error(( localize(9366, "Unable to create '{0}' ({1}).", (file.toString()), error))));
|
|
148
148
|
});
|
|
149
149
|
return Promise.resolve();
|
|
150
150
|
}
|
|
@@ -20,7 +20,7 @@ import { isIOS } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platfo
|
|
|
20
20
|
minimum: 1,
|
|
21
21
|
maximum: 20,
|
|
22
22
|
description: ( localize(
|
|
23
|
-
|
|
23
|
+
9889,
|
|
24
24
|
"Controls the feedback area size in pixels of the dragging area in between views/editors. Set it to a larger value if you feel it's hard to resize views using the mouse."
|
|
25
25
|
))
|
|
26
26
|
},
|
|
@@ -30,7 +30,7 @@ import { isIOS } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platfo
|
|
|
30
30
|
minimum: 0,
|
|
31
31
|
maximum: 2000,
|
|
32
32
|
description: ( localize(
|
|
33
|
-
|
|
33
|
+
9890,
|
|
34
34
|
"Controls the hover feedback delay in milliseconds of the dragging area in between views/editors."
|
|
35
35
|
))
|
|
36
36
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
|
|
2
|
+
import { registerWorkbenchContribution2, WorkbenchPhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions';
|
|
3
|
+
import { SyncScroll } from './scrollLocking.js';
|
|
4
|
+
|
|
5
|
+
registerWorkbenchContribution2(SyncScroll.ID, SyncScroll, WorkbenchPhase.Eventually
|
|
6
|
+
);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
|
|
3
|
+
import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
4
|
+
import { IStatusbarService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/statusbar/browser/statusbar.service";
|
|
5
|
+
export declare class SyncScroll extends Disposable implements IWorkbenchContribution {
|
|
6
|
+
private readonly editorService;
|
|
7
|
+
private readonly statusbarService;
|
|
8
|
+
static readonly ID = "workbench.contrib.syncScrolling";
|
|
9
|
+
private readonly paneInitialScrollTop;
|
|
10
|
+
private readonly syncScrollDispoasbles;
|
|
11
|
+
private readonly paneDisposables;
|
|
12
|
+
private readonly statusBarEntry;
|
|
13
|
+
private isActive;
|
|
14
|
+
constructor(editorService: IEditorService, statusbarService: IStatusbarService);
|
|
15
|
+
private registerActiveListeners;
|
|
16
|
+
private activate;
|
|
17
|
+
toggle(): void;
|
|
18
|
+
private _reentrancyBarrier;
|
|
19
|
+
private trackVisiblePanes;
|
|
20
|
+
private onDidEditorPaneScroll;
|
|
21
|
+
private getAllVisiblePanes;
|
|
22
|
+
private deactivate;
|
|
23
|
+
private toggleStatusbarItem;
|
|
24
|
+
private registerActions;
|
|
25
|
+
dispose(): void;
|
|
26
|
+
}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { Disposable, DisposableStore, MutableDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
|
+
import { localize, localize2 } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
5
|
+
import { Categories } from '@codingame/monaco-vscode-api/vscode/vs/platform/action/common/actionCommonCategories';
|
|
6
|
+
import { registerAction2, Action2 } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
7
|
+
import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
8
|
+
import { SideBySideEditor } from '@codingame/monaco-vscode-bc6d9a89-1625-5010-b57e-ff44151144fe-common/vscode/vs/workbench/browser/parts/editor/sideBySideEditor';
|
|
9
|
+
import { isEditorPaneWithScrolling } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor';
|
|
10
|
+
import { ReentrancyBarrier } from '@codingame/monaco-vscode-8ccb7637-50ea-5359-97bf-00015d7fe567-common/vscode/vs/base/common/controlFlow';
|
|
11
|
+
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
12
|
+
import { StatusbarAlignment } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/statusbar/browser/statusbar';
|
|
13
|
+
import { IStatusbarService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/statusbar/browser/statusbar.service';
|
|
14
|
+
|
|
15
|
+
let SyncScroll = class SyncScroll extends Disposable {
|
|
16
|
+
static { this.ID = 'workbench.contrib.syncScrolling'; }
|
|
17
|
+
constructor(editorService, statusbarService) {
|
|
18
|
+
super();
|
|
19
|
+
this.editorService = editorService;
|
|
20
|
+
this.statusbarService = statusbarService;
|
|
21
|
+
this.paneInitialScrollTop = ( new Map());
|
|
22
|
+
this.syncScrollDispoasbles = this._register(( new DisposableStore()));
|
|
23
|
+
this.paneDisposables = ( new DisposableStore());
|
|
24
|
+
this.statusBarEntry = this._register(( new MutableDisposable()));
|
|
25
|
+
this.isActive = false;
|
|
26
|
+
this._reentrancyBarrier = ( new ReentrancyBarrier());
|
|
27
|
+
this.registerActions();
|
|
28
|
+
}
|
|
29
|
+
registerActiveListeners() {
|
|
30
|
+
this.syncScrollDispoasbles.add(this.editorService.onDidVisibleEditorsChange(() => this.trackVisiblePanes()));
|
|
31
|
+
}
|
|
32
|
+
activate() {
|
|
33
|
+
this.registerActiveListeners();
|
|
34
|
+
this.trackVisiblePanes();
|
|
35
|
+
}
|
|
36
|
+
toggle() {
|
|
37
|
+
if (this.isActive) {
|
|
38
|
+
this.deactivate();
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
this.activate();
|
|
42
|
+
}
|
|
43
|
+
this.isActive = !this.isActive;
|
|
44
|
+
this.toggleStatusbarItem(this.isActive);
|
|
45
|
+
}
|
|
46
|
+
trackVisiblePanes() {
|
|
47
|
+
this.paneDisposables.clear();
|
|
48
|
+
this.paneInitialScrollTop.clear();
|
|
49
|
+
for (const pane of this.getAllVisiblePanes()) {
|
|
50
|
+
if (!isEditorPaneWithScrolling(pane)) {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
this.paneInitialScrollTop.set(pane, pane.getScrollPosition());
|
|
54
|
+
this.paneDisposables.add(pane.onDidChangeScroll(() => this._reentrancyBarrier.runExclusivelyOrSkip(() => {
|
|
55
|
+
this.onDidEditorPaneScroll(pane);
|
|
56
|
+
})));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
onDidEditorPaneScroll(scrolledPane) {
|
|
60
|
+
const scrolledPaneInitialOffset = this.paneInitialScrollTop.get(scrolledPane);
|
|
61
|
+
if (scrolledPaneInitialOffset === undefined) {
|
|
62
|
+
throw ( new Error('Scrolled pane not tracked'));
|
|
63
|
+
}
|
|
64
|
+
if (!isEditorPaneWithScrolling(scrolledPane)) {
|
|
65
|
+
throw ( new Error('Scrolled pane does not support scrolling'));
|
|
66
|
+
}
|
|
67
|
+
const scrolledPaneCurrentPosition = scrolledPane.getScrollPosition();
|
|
68
|
+
const scrolledFromInitial = {
|
|
69
|
+
scrollTop: scrolledPaneCurrentPosition.scrollTop - scrolledPaneInitialOffset.scrollTop,
|
|
70
|
+
scrollLeft: scrolledPaneCurrentPosition.scrollLeft !== undefined && scrolledPaneInitialOffset.scrollLeft !== undefined ? scrolledPaneCurrentPosition.scrollLeft - scrolledPaneInitialOffset.scrollLeft : undefined,
|
|
71
|
+
};
|
|
72
|
+
for (const pane of this.getAllVisiblePanes()) {
|
|
73
|
+
if (pane === scrolledPane) {
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
if (!isEditorPaneWithScrolling(pane)) {
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
const initialOffset = this.paneInitialScrollTop.get(pane);
|
|
80
|
+
if (initialOffset === undefined) {
|
|
81
|
+
throw ( new Error('Could not find initial offset for pane'));
|
|
82
|
+
}
|
|
83
|
+
const currentPanePosition = pane.getScrollPosition();
|
|
84
|
+
const newPaneScrollPosition = {
|
|
85
|
+
scrollTop: initialOffset.scrollTop + scrolledFromInitial.scrollTop,
|
|
86
|
+
scrollLeft: initialOffset.scrollLeft !== undefined && scrolledFromInitial.scrollLeft !== undefined ? initialOffset.scrollLeft + scrolledFromInitial.scrollLeft : undefined,
|
|
87
|
+
};
|
|
88
|
+
if (currentPanePosition.scrollTop === newPaneScrollPosition.scrollTop && currentPanePosition.scrollLeft === newPaneScrollPosition.scrollLeft) {
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
pane.setScrollPosition(newPaneScrollPosition);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
getAllVisiblePanes() {
|
|
95
|
+
const panes = [];
|
|
96
|
+
for (const pane of this.editorService.visibleEditorPanes) {
|
|
97
|
+
if (pane instanceof SideBySideEditor) {
|
|
98
|
+
const primaryPane = pane.getPrimaryEditorPane();
|
|
99
|
+
const secondaryPane = pane.getSecondaryEditorPane();
|
|
100
|
+
if (primaryPane) {
|
|
101
|
+
panes.push(primaryPane);
|
|
102
|
+
}
|
|
103
|
+
if (secondaryPane) {
|
|
104
|
+
panes.push(secondaryPane);
|
|
105
|
+
}
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
panes.push(pane);
|
|
109
|
+
}
|
|
110
|
+
return panes;
|
|
111
|
+
}
|
|
112
|
+
deactivate() {
|
|
113
|
+
this.paneDisposables.clear();
|
|
114
|
+
this.syncScrollDispoasbles.clear();
|
|
115
|
+
this.paneInitialScrollTop.clear();
|
|
116
|
+
}
|
|
117
|
+
toggleStatusbarItem(active) {
|
|
118
|
+
if (active) {
|
|
119
|
+
if (!this.statusBarEntry.value) {
|
|
120
|
+
const text = ( localize(10101, 'Scrolling Locked'));
|
|
121
|
+
const tooltip = ( localize(10102, 'Lock Scrolling Enabled'));
|
|
122
|
+
this.statusBarEntry.value = this.statusbarService.addEntry({
|
|
123
|
+
name: text,
|
|
124
|
+
text,
|
|
125
|
+
tooltip,
|
|
126
|
+
ariaLabel: text,
|
|
127
|
+
command: {
|
|
128
|
+
id: 'workbench.action.toggleLockedScrolling',
|
|
129
|
+
title: ''
|
|
130
|
+
},
|
|
131
|
+
kind: 'prominent',
|
|
132
|
+
showInAllWindows: true
|
|
133
|
+
}, 'status.scrollLockingEnabled', StatusbarAlignment.RIGHT, 102);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
this.statusBarEntry.clear();
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
registerActions() {
|
|
141
|
+
const $this = this;
|
|
142
|
+
this._register(registerAction2(class extends Action2 {
|
|
143
|
+
constructor() {
|
|
144
|
+
super({
|
|
145
|
+
id: 'workbench.action.toggleLockedScrolling',
|
|
146
|
+
title: {
|
|
147
|
+
...( localize2(10103, "Toggle Locked Scrolling Across Editors")),
|
|
148
|
+
mnemonicTitle: ( localize(10104, "Locked Scrolling")),
|
|
149
|
+
},
|
|
150
|
+
category: Categories.View,
|
|
151
|
+
f1: true,
|
|
152
|
+
metadata: {
|
|
153
|
+
description: ( localize(10105, "Synchronize Scrolling Editors")),
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
run() {
|
|
158
|
+
$this.toggle();
|
|
159
|
+
}
|
|
160
|
+
}));
|
|
161
|
+
this._register(registerAction2(class extends Action2 {
|
|
162
|
+
constructor() {
|
|
163
|
+
super({
|
|
164
|
+
id: 'workbench.action.holdLockedScrolling',
|
|
165
|
+
title: {
|
|
166
|
+
...( localize2(10106, "Hold Locked Scrolling Across Editors")),
|
|
167
|
+
mnemonicTitle: ( localize(10107, "Locked Scrolling")),
|
|
168
|
+
},
|
|
169
|
+
category: Categories.View,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
run(accessor) {
|
|
173
|
+
const keybindingService = accessor.get(IKeybindingService);
|
|
174
|
+
$this.toggle();
|
|
175
|
+
const holdMode = keybindingService.enableKeybindingHoldMode('workbench.action.holdLockedScrolling');
|
|
176
|
+
if (!holdMode) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
holdMode.finally(() => {
|
|
180
|
+
$this.toggle();
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}));
|
|
184
|
+
}
|
|
185
|
+
dispose() {
|
|
186
|
+
this.deactivate();
|
|
187
|
+
super.dispose();
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
SyncScroll = ( __decorate([
|
|
191
|
+
( __param(0, IEditorService)),
|
|
192
|
+
( __param(1, IStatusbarService))
|
|
193
|
+
], SyncScroll));
|
|
194
|
+
|
|
195
|
+
export { SyncScroll };
|
|
@@ -22,12 +22,12 @@ import { TypeHierarchyTreePeekWidget } from './typeHierarchyPeek.js';
|
|
|
22
22
|
import { TypeHierarchyDirection, TypeHierarchyProviderRegistry, TypeHierarchyModel } from '@codingame/monaco-vscode-7f39b6f1-3542-5430-8760-0f404d7a7cee-common/vscode/vs/workbench/contrib/typeHierarchy/common/typeHierarchy';
|
|
23
23
|
|
|
24
24
|
var TypeHierarchyController_1;
|
|
25
|
-
const _ctxHasTypeHierarchyProvider = ( new RawContextKey('editorHasTypeHierarchyProvider', false, ( localize(
|
|
26
|
-
const _ctxTypeHierarchyVisible = ( new RawContextKey('typeHierarchyVisible', false, ( localize(
|
|
25
|
+
const _ctxHasTypeHierarchyProvider = ( new RawContextKey('editorHasTypeHierarchyProvider', false, ( localize(12197, 'Whether a type hierarchy provider is available'))));
|
|
26
|
+
const _ctxTypeHierarchyVisible = ( new RawContextKey('typeHierarchyVisible', false, ( localize(12198, 'Whether type hierarchy peek is currently showing'))));
|
|
27
27
|
const _ctxTypeHierarchyDirection = ( new RawContextKey(
|
|
28
28
|
'typeHierarchyDirection',
|
|
29
29
|
undefined,
|
|
30
|
-
{ type: 'string', description: ( localize(
|
|
30
|
+
{ type: 'string', description: ( localize(12199, 'whether type hierarchy shows super types or subtypes')) }
|
|
31
31
|
));
|
|
32
32
|
function sanitizedDirection(candidate) {
|
|
33
33
|
return candidate === TypeHierarchyDirection.Subtypes || candidate === TypeHierarchyDirection.Supertypes
|
|
@@ -96,14 +96,14 @@ let TypeHierarchyController = class TypeHierarchyController {
|
|
|
96
96
|
this._widget.showModel(model);
|
|
97
97
|
}
|
|
98
98
|
else {
|
|
99
|
-
this._widget.showMessage(( localize(
|
|
99
|
+
this._widget.showMessage(( localize(12200, "No results")));
|
|
100
100
|
}
|
|
101
101
|
}).catch(err => {
|
|
102
102
|
if (isCancellationError(err)) {
|
|
103
103
|
this.endTypeHierarchy();
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
|
-
this._widget.showMessage(( localize(
|
|
106
|
+
this._widget.showMessage(( localize(12201, "Failed to show type hierarchy")));
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
109
|
async startTypeHierarchyFromTypeHierarchy() {
|
|
@@ -148,7 +148,7 @@ registerAction2(class PeekTypeHierarchyAction extends EditorAction2 {
|
|
|
148
148
|
constructor() {
|
|
149
149
|
super({
|
|
150
150
|
id: 'editor.showTypeHierarchy',
|
|
151
|
-
title: ( localize2(
|
|
151
|
+
title: ( localize2(12202, 'Peek Type Hierarchy')),
|
|
152
152
|
menu: {
|
|
153
153
|
id: MenuId.EditorContextPeek,
|
|
154
154
|
group: 'navigation',
|
|
@@ -167,7 +167,7 @@ registerAction2(class extends EditorAction2 {
|
|
|
167
167
|
constructor() {
|
|
168
168
|
super({
|
|
169
169
|
id: 'editor.showSupertypes',
|
|
170
|
-
title: ( localize2(
|
|
170
|
+
title: ( localize2(12203, 'Show Supertypes')),
|
|
171
171
|
icon: Codicon.typeHierarchySuper,
|
|
172
172
|
precondition: ( ContextKeyExpr.and(_ctxTypeHierarchyVisible, ( _ctxTypeHierarchyDirection.isEqualTo(TypeHierarchyDirection.Subtypes)))),
|
|
173
173
|
keybinding: {
|
|
@@ -189,7 +189,7 @@ registerAction2(class extends EditorAction2 {
|
|
|
189
189
|
constructor() {
|
|
190
190
|
super({
|
|
191
191
|
id: 'editor.showSubtypes',
|
|
192
|
-
title: ( localize2(
|
|
192
|
+
title: ( localize2(12204, 'Show Subtypes')),
|
|
193
193
|
icon: Codicon.typeHierarchySub,
|
|
194
194
|
precondition: ( ContextKeyExpr.and(_ctxTypeHierarchyVisible, ( _ctxTypeHierarchyDirection.isEqualTo(TypeHierarchyDirection.Supertypes)))),
|
|
195
195
|
keybinding: {
|
|
@@ -211,7 +211,7 @@ registerAction2(class extends EditorAction2 {
|
|
|
211
211
|
constructor() {
|
|
212
212
|
super({
|
|
213
213
|
id: 'editor.refocusTypeHierarchy',
|
|
214
|
-
title: ( localize2(
|
|
214
|
+
title: ( localize2(12205, 'Refocus Type Hierarchy')),
|
|
215
215
|
precondition: _ctxTypeHierarchyVisible,
|
|
216
216
|
keybinding: {
|
|
217
217
|
weight: KeybindingWeight.WorkbenchContrib,
|
|
@@ -227,7 +227,7 @@ registerAction2(class extends EditorAction2 {
|
|
|
227
227
|
constructor() {
|
|
228
228
|
super({
|
|
229
229
|
id: 'editor.closeTypeHierarchy',
|
|
230
|
-
title: ( localize(
|
|
230
|
+
title: ( localize(12206, 'Close')),
|
|
231
231
|
icon: Codicon.close,
|
|
232
232
|
precondition: _ctxTypeHierarchyVisible,
|
|
233
233
|
keybinding: {
|
|
@@ -265,13 +265,13 @@ let TypeHierarchyTreePeekWidget = class TypeHierarchyTreePeekWidget extends Peek
|
|
|
265
265
|
}
|
|
266
266
|
this._previewDisposable.add(value);
|
|
267
267
|
const title = this._direction === TypeHierarchyDirection.Supertypes
|
|
268
|
-
? ( localize(
|
|
269
|
-
: ( localize(
|
|
268
|
+
? ( localize(12207, "Supertypes of '{0}'", element.model.root.name))
|
|
269
|
+
: ( localize(12208, "Subtypes of '{0}'", element.model.root.name));
|
|
270
270
|
this.setTitle(title);
|
|
271
271
|
}
|
|
272
272
|
showLoading() {
|
|
273
273
|
this._parent.dataset['state'] = State.Loading;
|
|
274
|
-
this.setTitle(( localize(
|
|
274
|
+
this.setTitle(( localize(12209, "Loading...")));
|
|
275
275
|
this._show();
|
|
276
276
|
}
|
|
277
277
|
showMessage(message) {
|
|
@@ -290,8 +290,8 @@ let TypeHierarchyTreePeekWidget = class TypeHierarchyTreePeekWidget extends Peek
|
|
|
290
290
|
await this._tree.expand(root.element);
|
|
291
291
|
if (root.children.length === 0) {
|
|
292
292
|
this.showMessage(this._direction === TypeHierarchyDirection.Supertypes
|
|
293
|
-
? ( localize(
|
|
294
|
-
: ( localize(
|
|
293
|
+
? ( localize(12210, "No supertypes of '{0}'", model.root.name))
|
|
294
|
+
: ( localize(12211, "No subtypes of '{0}'", model.root.name)));
|
|
295
295
|
}
|
|
296
296
|
else {
|
|
297
297
|
this._parent.dataset['state'] = State.Data;
|
|
@@ -106,14 +106,14 @@ class AccessibilityProvider {
|
|
|
106
106
|
this.getDirection = getDirection;
|
|
107
107
|
}
|
|
108
108
|
getWidgetAriaLabel() {
|
|
109
|
-
return localize(
|
|
109
|
+
return localize(12212, "Type Hierarchy");
|
|
110
110
|
}
|
|
111
111
|
getAriaLabel(element) {
|
|
112
112
|
if (this.getDirection() === TypeHierarchyDirection.Supertypes) {
|
|
113
|
-
return localize(
|
|
113
|
+
return localize(12213, "supertypes of {0}", element.item.name);
|
|
114
114
|
}
|
|
115
115
|
else {
|
|
116
|
-
return localize(
|
|
116
|
+
return localize(12214, "subtypes of {0}", element.item.name);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
}
|
|
@@ -158,7 +158,7 @@ let WebviewElement = class WebviewElement extends Disposable {
|
|
|
158
158
|
this._hasFindResult.fire(didFind);
|
|
159
159
|
}));
|
|
160
160
|
this._register(this.on('fatal-error', (e) => {
|
|
161
|
-
notificationService.error(( localize(
|
|
161
|
+
notificationService.error(( localize(12514, "Error loading webview: {0}", e.message)));
|
|
162
162
|
this._onFatalError.fire({ message: e.message });
|
|
163
163
|
}));
|
|
164
164
|
this._register(this.on('did-keydown', (data) => {
|
|
@@ -15,7 +15,7 @@ import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench
|
|
|
15
15
|
const webviewActiveContextKeyExpr = ( ContextKeyExpr.and(( ContextKeyExpr.equals('activeEditor', WebviewEditor.ID)), ( EditorContextKeys.focus.toNegated() )));
|
|
16
16
|
class ShowWebViewEditorFindWidgetAction extends Action2 {
|
|
17
17
|
static { this.ID = 'editor.action.webvieweditor.showFind'; }
|
|
18
|
-
static { this.LABEL = ( localize(
|
|
18
|
+
static { this.LABEL = ( localize(12515, "Show find")); }
|
|
19
19
|
constructor() {
|
|
20
20
|
super({
|
|
21
21
|
id: ShowWebViewEditorFindWidgetAction.ID,
|
|
@@ -36,7 +36,7 @@ class ShowWebViewEditorFindWidgetAction extends Action2 {
|
|
|
36
36
|
}
|
|
37
37
|
class HideWebViewEditorFindCommand extends Action2 {
|
|
38
38
|
static { this.ID = 'editor.action.webvieweditor.hideFind'; }
|
|
39
|
-
static { this.LABEL = ( localize(
|
|
39
|
+
static { this.LABEL = ( localize(12516, "Stop find")); }
|
|
40
40
|
constructor() {
|
|
41
41
|
super({
|
|
42
42
|
id: HideWebViewEditorFindCommand.ID,
|
|
@@ -57,7 +57,7 @@ class HideWebViewEditorFindCommand extends Action2 {
|
|
|
57
57
|
}
|
|
58
58
|
class WebViewEditorFindNextCommand extends Action2 {
|
|
59
59
|
static { this.ID = 'editor.action.webvieweditor.findNext'; }
|
|
60
|
-
static { this.LABEL = ( localize(
|
|
60
|
+
static { this.LABEL = ( localize(12517, 'Find next')); }
|
|
61
61
|
constructor() {
|
|
62
62
|
super({
|
|
63
63
|
id: WebViewEditorFindNextCommand.ID,
|
|
@@ -78,7 +78,7 @@ class WebViewEditorFindNextCommand extends Action2 {
|
|
|
78
78
|
}
|
|
79
79
|
class WebViewEditorFindPreviousCommand extends Action2 {
|
|
80
80
|
static { this.ID = 'editor.action.webvieweditor.findPrevious'; }
|
|
81
|
-
static { this.LABEL = ( localize(
|
|
81
|
+
static { this.LABEL = ( localize(12518, 'Find previous')); }
|
|
82
82
|
constructor() {
|
|
83
83
|
super({
|
|
84
84
|
id: WebViewEditorFindPreviousCommand.ID,
|
|
@@ -99,7 +99,7 @@ class WebViewEditorFindPreviousCommand extends Action2 {
|
|
|
99
99
|
}
|
|
100
100
|
class ReloadWebviewAction extends Action2 {
|
|
101
101
|
static { this.ID = 'workbench.action.webview.reloadWebviewAction'; }
|
|
102
|
-
static { this.LABEL = ( localize2(
|
|
102
|
+
static { this.LABEL = ( localize2(12519, "Reload Webviews")); }
|
|
103
103
|
constructor() {
|
|
104
104
|
super({
|
|
105
105
|
id: ReloadWebviewAction.ID,
|
|
@@ -18,7 +18,7 @@ import '@codingame/monaco-vscode-7f39b6f1-3542-5430-8760-0f404d7a7cee-common/vsc
|
|
|
18
18
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
19
19
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
20
20
|
|
|
21
|
-
(( Registry.as(EditorExtensions.EditorPane))).registerEditorPane(EditorPaneDescriptor.create(WebviewEditor, WebviewEditor.ID, ( localize(
|
|
21
|
+
(( Registry.as(EditorExtensions.EditorPane))).registerEditorPane(EditorPaneDescriptor.create(WebviewEditor, WebviewEditor.ID, ( localize(12521, "webview editor"))), [( new SyncDescriptor(WebviewInput))]);
|
|
22
22
|
let WebviewPanelContribution = class WebviewPanelContribution extends Disposable {
|
|
23
23
|
static { this.ID = 'workbench.contrib.webviewPanel'; }
|
|
24
24
|
constructor(editorService, editorGroupService) {
|