@codingame/monaco-vscode-view-common-service-override 4.5.1 → 5.0.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/package.json +3 -3
- package/viewCommon.js +3 -6
- package/vscode/src/vs/base/browser/ui/grid/grid.js +12 -12
- package/vscode/src/vs/base/browser/ui/grid/gridview.js +26 -26
- package/vscode/src/vs/platform/languagePacks/common/localizedStrings.js +4 -3
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +142 -221
- package/vscode/src/vs/workbench/browser/actions/listCommands.js +49 -45
- package/vscode/src/vs/workbench/browser/actions/navigationActions.js +7 -30
- package/vscode/src/vs/workbench/browser/media/style.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +67 -138
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +25 -38
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/compositeBar.js +26 -27
- package/vscode/src/vs/workbench/browser/parts/compositePart.js +20 -34
- package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +7 -4
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +216 -765
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +27 -42
- package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +24 -23
- package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +54 -19
- package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +122 -72
- package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +51 -54
- package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +44 -44
- package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +25 -26
- package/vscode/src/vs/workbench/browser/parts/sidebar/media/sidebarpart.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarActions.js +2 -5
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +22 -22
- package/vscode/src/vs/workbench/browser/window.js +41 -92
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +41 -78
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +23 -46
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +36 -27
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +1 -1
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +1 -1
- package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +14 -15
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditor.js +10 -11
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.js +1 -1
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +25 -52
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +59 -88
- package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.js +18 -48
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +61 -150
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +15 -70
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +9 -20
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +14 -65
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +39 -113
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.js +1 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +13 -19
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +1 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +35 -75
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +16 -37
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +41 -43
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +6 -5
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +13 -11
- package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.js +24 -61
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.js +7 -6
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +37 -70
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +23 -46
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +26 -27
- package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.js +2 -2
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +50 -52
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.js +5 -3
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +18 -34
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +7 -10
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +13 -11
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewService.js +2 -2
- package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +79 -49
- package/vscode/src/vs/workbench/services/driver/browser/driver.js +9 -7
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +45 -68
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +95 -98
- package/vscode/src/vs/workbench/services/progress/browser/progressService.js +34 -74
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +69 -67
- package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +52 -47
package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js
CHANGED
|
@@ -11,6 +11,7 @@ import { derivedOpts, derived } from 'vscode/vscode/vs/base/common/observableInt
|
|
|
11
11
|
import { autorunOpts, autorun } from 'vscode/vscode/vs/base/common/observableInternal/autorun';
|
|
12
12
|
import 'vscode/vscode/vs/base/common/observableInternal/utils';
|
|
13
13
|
import 'vscode/vscode/vs/base/common/cancellation';
|
|
14
|
+
import 'vscode/vscode/vs/base/common/arrays';
|
|
14
15
|
import { noBreakWhitespace } from 'vscode/vscode/vs/base/common/strings';
|
|
15
16
|
import { isDefined } from 'vscode/vscode/vs/base/common/types';
|
|
16
17
|
import { OverviewRulerLane } from 'vscode/vscode/vs/editor/common/model';
|
|
@@ -25,6 +26,7 @@ import { handledConflictMinimapOverViewRulerColor, unhandledConflictMinimapOverV
|
|
|
25
26
|
import { EditorGutter } from '../editorGutter.js';
|
|
26
27
|
import { CodeEditorView, createSelectionsAutorun, TitleMenu } from './codeEditorView.js';
|
|
27
28
|
|
|
29
|
+
const _moduleId = "vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView";
|
|
28
30
|
let InputCodeEditorView = class InputCodeEditorView extends CodeEditorView {
|
|
29
31
|
constructor(inputNumber, viewModel, instantiationService, contextMenuService, configurationService) {
|
|
30
32
|
super(instantiationService, viewModel, configurationService);
|
|
@@ -38,9 +40,13 @@ let InputCodeEditorView = class InputCodeEditorView extends CodeEditorView {
|
|
|
38
40
|
const model = viewModel.model;
|
|
39
41
|
const inputNumber = this.inputNumber;
|
|
40
42
|
const showNonConflictingChanges = viewModel.showNonConflictingChanges.read(reader);
|
|
41
|
-
return (
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
return (
|
|
44
|
+
(model.modifiedBaseRanges.read(reader)
|
|
45
|
+
.filter((r) => r.getInputDiffs(this.inputNumber).length > 0 && (showNonConflictingChanges || r.isConflicting || !model.isHandled(r).read(reader)))
|
|
46
|
+
.map(
|
|
47
|
+
(baseRange, idx) => ( (new ModifiedBaseRangeGutterItemModel( (idx.toString()), baseRange, inputNumber, viewModel)))
|
|
48
|
+
))
|
|
49
|
+
);
|
|
44
50
|
});
|
|
45
51
|
this.decorations = derivedOpts({ debugName: `input${this.inputNumber}.decorations` }, reader => {
|
|
46
52
|
const viewModel = this.viewModel.read(reader);
|
|
@@ -50,7 +56,7 @@ let InputCodeEditorView = class InputCodeEditorView extends CodeEditorView {
|
|
|
50
56
|
const model = viewModel.model;
|
|
51
57
|
const textModel = (this.inputNumber === 1 ? model.input1 : model.input2).textModel;
|
|
52
58
|
const activeModifiedBaseRange = viewModel.activeModifiedBaseRange.read(reader);
|
|
53
|
-
const result = ( new Array());
|
|
59
|
+
const result = ( (new Array()));
|
|
54
60
|
const showNonConflictingChanges = viewModel.showNonConflictingChanges.read(reader);
|
|
55
61
|
const showDeletionMarkers = this.showDeletionMarkers.read(reader);
|
|
56
62
|
const diffWithThis = viewModel.baseCodeEditorView.read(reader) !== undefined && viewModel.baseShowDiffAgainst.read(reader) === this.inputNumber;
|
|
@@ -133,7 +139,7 @@ let InputCodeEditorView = class InputCodeEditorView extends CodeEditorView {
|
|
|
133
139
|
return result;
|
|
134
140
|
});
|
|
135
141
|
this.htmlElements.root.classList.add(`input`);
|
|
136
|
-
this._register(( new EditorGutter(this.editor, this.htmlElements.gutterDiv, {
|
|
142
|
+
this._register(( (new EditorGutter(this.editor, this.htmlElements.gutterDiv, {
|
|
137
143
|
getIntersectingGutterItems: (range, reader) => {
|
|
138
144
|
if (this.checkboxesVisible.read(reader)) {
|
|
139
145
|
return this.modifiedBaseRangeGutterItemInfos.read(reader);
|
|
@@ -142,8 +148,8 @@ let InputCodeEditorView = class InputCodeEditorView extends CodeEditorView {
|
|
|
142
148
|
return [];
|
|
143
149
|
}
|
|
144
150
|
},
|
|
145
|
-
createView: (item, target) => ( new MergeConflictGutterItemView(item, target, contextMenuService)),
|
|
146
|
-
})));
|
|
151
|
+
createView: (item, target) => ( (new MergeConflictGutterItemView(item, target, contextMenuService))),
|
|
152
|
+
}))));
|
|
147
153
|
this._register(createSelectionsAutorun(this, (baseRange, viewModel) => viewModel.model.translateBaseRangeToInput(this.inputNumber, baseRange)));
|
|
148
154
|
this._register(instantiationService.createInstance(TitleMenu, inputNumber === 1 ? MenuId.MergeInput1Toolbar : MenuId.MergeInput2Toolbar, this.htmlElements.toolbar));
|
|
149
155
|
this._register(autorunOpts({ debugName: `input${this.inputNumber}: update labels & text model` }, reader => {
|
|
@@ -153,16 +159,8 @@ let InputCodeEditorView = class InputCodeEditorView extends CodeEditorView {
|
|
|
153
159
|
}
|
|
154
160
|
this.editor.setModel(this.inputNumber === 1 ? vm.model.input1.textModel : vm.model.input2.textModel);
|
|
155
161
|
const title = this.inputNumber === 1
|
|
156
|
-
? vm.model.input1.title || ( localizeWithPath(
|
|
157
|
-
'
|
|
158
|
-
'input1',
|
|
159
|
-
'Input 1'
|
|
160
|
-
))
|
|
161
|
-
: vm.model.input2.title || ( localizeWithPath(
|
|
162
|
-
'vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView',
|
|
163
|
-
'input2',
|
|
164
|
-
'Input 2'
|
|
165
|
-
));
|
|
162
|
+
? vm.model.input1.title || ( localizeWithPath(_moduleId, 0, 'Input 1'))
|
|
163
|
+
: vm.model.input2.title || ( localizeWithPath(_moduleId, 1, 'Input 2'));
|
|
166
164
|
const description = this.inputNumber === 1
|
|
167
165
|
? vm.model.input1.description
|
|
168
166
|
: vm.model.input2.description;
|
|
@@ -176,11 +174,11 @@ let InputCodeEditorView = class InputCodeEditorView extends CodeEditorView {
|
|
|
176
174
|
this._register(applyObservableDecorations(this.editor, this.decorations));
|
|
177
175
|
}
|
|
178
176
|
};
|
|
179
|
-
InputCodeEditorView = ( __decorate([
|
|
180
|
-
( __param(2, IInstantiationService)),
|
|
181
|
-
( __param(3, IContextMenuService)),
|
|
182
|
-
( __param(4, IConfigurationService))
|
|
183
|
-
], InputCodeEditorView));
|
|
177
|
+
InputCodeEditorView = ( (__decorate([
|
|
178
|
+
( (__param(2, IInstantiationService))),
|
|
179
|
+
( (__param(3, IContextMenuService))),
|
|
180
|
+
( (__param(4, IConfigurationService)))
|
|
181
|
+
], InputCodeEditorView)));
|
|
184
182
|
class ModifiedBaseRangeGutterItemModel {
|
|
185
183
|
constructor(id, baseRange, inputNumber, viewModel) {
|
|
186
184
|
this.id = id;
|
|
@@ -235,54 +233,32 @@ class ModifiedBaseRangeGutterItemModel {
|
|
|
235
233
|
});
|
|
236
234
|
};
|
|
237
235
|
function action(id, label, targetState, checked) {
|
|
238
|
-
const action = ( new Action(id, label, undefined, true, () => {
|
|
236
|
+
const action = ( (new Action(id, label, undefined, true, () => {
|
|
239
237
|
update(targetState);
|
|
240
|
-
}));
|
|
238
|
+
})));
|
|
241
239
|
action.checked = checked;
|
|
242
240
|
return action;
|
|
243
241
|
}
|
|
244
242
|
const both = state.includesInput1 && state.includesInput2;
|
|
245
243
|
return [
|
|
246
244
|
this.baseRange.input1Diffs.length > 0
|
|
247
|
-
? action('mergeEditor.acceptInput1', ( localizeWithPath(
|
|
248
|
-
'vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView',
|
|
249
|
-
'mergeEditor.accept',
|
|
250
|
-
'Accept {0}',
|
|
251
|
-
this.model.input1.title
|
|
252
|
-
)), state.toggle(1), state.includesInput1)
|
|
245
|
+
? action('mergeEditor.acceptInput1', ( localizeWithPath(_moduleId, 2, 'Accept {0}', this.model.input1.title)), state.toggle(1), state.includesInput1)
|
|
253
246
|
: undefined,
|
|
254
247
|
this.baseRange.input2Diffs.length > 0
|
|
255
|
-
? action('mergeEditor.acceptInput2', ( localizeWithPath(
|
|
256
|
-
'vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView',
|
|
257
|
-
'mergeEditor.accept',
|
|
258
|
-
'Accept {0}',
|
|
259
|
-
this.model.input2.title
|
|
260
|
-
)), state.toggle(2), state.includesInput2)
|
|
248
|
+
? action('mergeEditor.acceptInput2', ( localizeWithPath(_moduleId, 2, 'Accept {0}', this.model.input2.title)), state.toggle(2), state.includesInput2)
|
|
261
249
|
: undefined,
|
|
262
250
|
this.baseRange.isConflicting
|
|
263
|
-
? setFields(action('mergeEditor.acceptBoth', ( localizeWithPath(
|
|
264
|
-
'vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView',
|
|
265
|
-
'mergeEditor.acceptBoth',
|
|
266
|
-
'Accept Both'
|
|
267
|
-
)), state.withInputValue(1, !both).withInputValue(2, !both), both), { enabled: this.baseRange.canBeCombined })
|
|
251
|
+
? setFields(action('mergeEditor.acceptBoth', ( localizeWithPath(_moduleId, 3, 'Accept Both')), state.withInputValue(1, !both).withInputValue(2, !both), both), { enabled: this.baseRange.canBeCombined })
|
|
268
252
|
: undefined,
|
|
269
|
-
( new Separator()),
|
|
253
|
+
( (new Separator())),
|
|
270
254
|
this.baseRange.isConflicting
|
|
271
|
-
? setFields(action('mergeEditor.swap', ( localizeWithPath(
|
|
272
|
-
'vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView',
|
|
273
|
-
'mergeEditor.swap',
|
|
274
|
-
'Swap'
|
|
275
|
-
)), state.swap(), false), { enabled: !state.kind && (!both || this.baseRange.isOrderRelevant) })
|
|
255
|
+
? setFields(action('mergeEditor.swap', ( localizeWithPath(_moduleId, 4, 'Swap')), state.swap(), false), { enabled: !state.kind && (!both || this.baseRange.isOrderRelevant) })
|
|
276
256
|
: undefined,
|
|
277
|
-
setFields(( new Action('mergeEditor.markAsHandled', ( localizeWithPath(
|
|
278
|
-
'vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView',
|
|
279
|
-
'mergeEditor.markAsHandled',
|
|
280
|
-
'Mark as Handled'
|
|
281
|
-
)), undefined, true, () => {
|
|
257
|
+
setFields(( (new Action('mergeEditor.markAsHandled', ( localizeWithPath(_moduleId, 5, 'Mark as Handled')), undefined, true, () => {
|
|
282
258
|
transaction((tx) => {
|
|
283
259
|
this.model.setHandled(this.baseRange, !handled, tx);
|
|
284
260
|
});
|
|
285
|
-
})), { checked: handled }),
|
|
261
|
+
}))), { checked: handled }),
|
|
286
262
|
].filter(isDefined);
|
|
287
263
|
}
|
|
288
264
|
}
|
|
@@ -291,12 +267,12 @@ class MergeConflictGutterItemView extends Disposable {
|
|
|
291
267
|
super();
|
|
292
268
|
this.isMultiLine = observableValue(this, false);
|
|
293
269
|
this.item = observableValue(this, item);
|
|
294
|
-
const checkBox = ( new Toggle({
|
|
270
|
+
const checkBox = ( (new Toggle({
|
|
295
271
|
isChecked: false,
|
|
296
272
|
title: '',
|
|
297
273
|
icon: Codicon.check,
|
|
298
274
|
...defaultToggleStyles
|
|
299
|
-
}));
|
|
275
|
+
})));
|
|
300
276
|
checkBox.domNode.classList.add('accept-conflict-group');
|
|
301
277
|
this._register(addDisposableListener(checkBox.domNode, EventType.MOUSE_DOWN, (e) => {
|
|
302
278
|
const item = this.item.get();
|
|
@@ -321,26 +297,10 @@ class MergeConflictGutterItemView extends Disposable {
|
|
|
321
297
|
const item = this.item.read(reader);
|
|
322
298
|
const value = item.toggleState.read(reader);
|
|
323
299
|
const iconMap = {
|
|
324
|
-
[0 ]: { icon: undefined, checked: false, title: ( localizeWithPath(
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
)) },
|
|
329
|
-
[3 ]: { icon: Codicon.circleFilled, checked: false, title: ( localizeWithPath(
|
|
330
|
-
'vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView',
|
|
331
|
-
'accept.conflicting',
|
|
332
|
-
"Accept (result is dirty)"
|
|
333
|
-
)) },
|
|
334
|
-
[1 ]: { icon: Codicon.check, checked: true, title: ( localizeWithPath(
|
|
335
|
-
'vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView',
|
|
336
|
-
'accept.first',
|
|
337
|
-
"Undo accept"
|
|
338
|
-
)) },
|
|
339
|
-
[2 ]: { icon: Codicon.checkAll, checked: true, title: ( localizeWithPath(
|
|
340
|
-
'vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView',
|
|
341
|
-
'accept.second',
|
|
342
|
-
"Undo accept (currently second)"
|
|
343
|
-
)) },
|
|
300
|
+
[0 ]: { icon: undefined, checked: false, title: ( localizeWithPath(_moduleId, 6, "Accept")) },
|
|
301
|
+
[3 ]: { icon: Codicon.circleFilled, checked: false, title: ( localizeWithPath(_moduleId, 7, "Accept (result is dirty)")) },
|
|
302
|
+
[1 ]: { icon: Codicon.check, checked: true, title: ( localizeWithPath(_moduleId, 8, "Undo accept")) },
|
|
303
|
+
[2 ]: { icon: Codicon.checkAll, checked: true, title: ( localizeWithPath(_moduleId, 9, "Undo accept (currently second)")) },
|
|
344
304
|
};
|
|
345
305
|
const state = iconMap[value];
|
|
346
306
|
checkBox.setIcon(state.icon);
|
package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js
CHANGED
|
@@ -23,6 +23,7 @@ import { EditorGutter } from '../editorGutter.js';
|
|
|
23
23
|
import { ctxIsMergeResultEditor } from 'vscode/vscode/vs/workbench/contrib/mergeEditor/common/mergeEditor';
|
|
24
24
|
import { CodeEditorView, createSelectionsAutorun, TitleMenu } from './codeEditorView.js';
|
|
25
25
|
|
|
26
|
+
const _moduleId = "vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView";
|
|
26
27
|
let ResultCodeEditorView = class ResultCodeEditorView extends CodeEditorView {
|
|
27
28
|
constructor(viewModel, instantiationService, _labelService, configurationService) {
|
|
28
29
|
super(instantiationService, viewModel, configurationService);
|
|
@@ -34,7 +35,7 @@ let ResultCodeEditorView = class ResultCodeEditorView extends CodeEditorView {
|
|
|
34
35
|
}
|
|
35
36
|
const model = viewModel.model;
|
|
36
37
|
const textModel = model.resultTextModel;
|
|
37
|
-
const result = ( new Array());
|
|
38
|
+
const result = ( (new Array()));
|
|
38
39
|
const baseRangeWithStoreAndTouchingDiffs = join(model.modifiedBaseRanges.read(reader), model.baseResultDiffs.read(reader), (baseRange, diff) => baseRange.baseRange.touches(diff.inputRange)
|
|
39
40
|
? CompareResult.neitherLessOrGreaterThan
|
|
40
41
|
: LineRange.compareByStart(baseRange.baseRange, diff.inputRange));
|
|
@@ -119,10 +120,10 @@ let ResultCodeEditorView = class ResultCodeEditorView extends CodeEditorView {
|
|
|
119
120
|
this.htmlElements.root.classList.add(`result`);
|
|
120
121
|
this._register(autorunWithStore((reader, store) => {
|
|
121
122
|
if (this.checkboxesVisible.read(reader)) {
|
|
122
|
-
store.add(( new EditorGutter(this.editor, this.htmlElements.gutterDiv, {
|
|
123
|
+
store.add(( (new EditorGutter(this.editor, this.htmlElements.gutterDiv, {
|
|
123
124
|
getIntersectingGutterItems: (range, reader) => [],
|
|
124
|
-
createView: (item, target) => { throw new BugIndicatingError(); },
|
|
125
|
-
})));
|
|
125
|
+
createView: (item, target) => { throw ( (new BugIndicatingError())); },
|
|
126
|
+
}))));
|
|
126
127
|
}
|
|
127
128
|
}));
|
|
128
129
|
this._register(autorun(reader => {
|
|
@@ -131,14 +132,10 @@ let ResultCodeEditorView = class ResultCodeEditorView extends CodeEditorView {
|
|
|
131
132
|
return;
|
|
132
133
|
}
|
|
133
134
|
this.editor.setModel(vm.model.resultTextModel);
|
|
134
|
-
reset(this.htmlElements.title, ...renderLabelWithIcons(( localizeWithPath(
|
|
135
|
-
'vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView',
|
|
136
|
-
'result',
|
|
137
|
-
'Result'
|
|
138
|
-
))));
|
|
135
|
+
reset(this.htmlElements.title, ...renderLabelWithIcons(( localizeWithPath(_moduleId, 0, 'Result'))));
|
|
139
136
|
reset(this.htmlElements.description, ...renderLabelWithIcons(this._labelService.getUriLabel(vm.model.resultTextModel.uri, { relative: true })));
|
|
140
137
|
}));
|
|
141
|
-
const remainingConflictsActionBar = this._register(( new ActionBar(this.htmlElements.detail)));
|
|
138
|
+
const remainingConflictsActionBar = this._register(( (new ActionBar(this.htmlElements.detail))));
|
|
142
139
|
this._register(autorun(reader => {
|
|
143
140
|
const vm = this.viewModel.read(reader);
|
|
144
141
|
if (!vm) {
|
|
@@ -150,18 +147,8 @@ let ResultCodeEditorView = class ResultCodeEditorView extends CodeEditorView {
|
|
|
150
147
|
}
|
|
151
148
|
const count = model.unhandledConflictsCount.read(reader);
|
|
152
149
|
const text = count === 1
|
|
153
|
-
? ( localizeWithPath(
|
|
154
|
-
'
|
|
155
|
-
'mergeEditor.remainingConflicts',
|
|
156
|
-
'{0} Conflict Remaining',
|
|
157
|
-
count
|
|
158
|
-
))
|
|
159
|
-
: ( localizeWithPath(
|
|
160
|
-
'vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView',
|
|
161
|
-
'mergeEditor.remainingConflict',
|
|
162
|
-
'{0} Conflicts Remaining ',
|
|
163
|
-
count
|
|
164
|
-
));
|
|
150
|
+
? ( localizeWithPath(_moduleId, 1, '{0} Conflict Remaining', count))
|
|
151
|
+
: ( localizeWithPath(_moduleId, 2, '{0} Conflicts Remaining ', count));
|
|
165
152
|
remainingConflictsActionBar.clear();
|
|
166
153
|
remainingConflictsActionBar.push({
|
|
167
154
|
class: undefined,
|
|
@@ -173,16 +160,8 @@ let ResultCodeEditorView = class ResultCodeEditorView extends CodeEditorView {
|
|
|
173
160
|
vm.goToNextModifiedBaseRange(m => !model.isHandled(m).get());
|
|
174
161
|
},
|
|
175
162
|
tooltip: count > 0
|
|
176
|
-
? ( localizeWithPath(
|
|
177
|
-
'
|
|
178
|
-
'goToNextConflict',
|
|
179
|
-
'Go to next conflict'
|
|
180
|
-
))
|
|
181
|
-
: ( localizeWithPath(
|
|
182
|
-
'vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView',
|
|
183
|
-
'allConflictHandled',
|
|
184
|
-
'All conflicts handled, the merge can be completed now.'
|
|
185
|
-
)),
|
|
163
|
+
? ( localizeWithPath(_moduleId, 3, 'Go to next conflict'))
|
|
164
|
+
: ( localizeWithPath(_moduleId, 4, 'All conflicts handled, the merge can be completed now.')),
|
|
186
165
|
});
|
|
187
166
|
}));
|
|
188
167
|
this._register(applyObservableDecorations(this.editor, this.decorations));
|
|
@@ -190,10 +169,10 @@ let ResultCodeEditorView = class ResultCodeEditorView extends CodeEditorView {
|
|
|
190
169
|
this._register(instantiationService.createInstance(TitleMenu, MenuId.MergeInputResultToolbar, this.htmlElements.toolbar));
|
|
191
170
|
}
|
|
192
171
|
};
|
|
193
|
-
ResultCodeEditorView = ( __decorate([
|
|
194
|
-
( __param(1, IInstantiationService)),
|
|
195
|
-
( __param(2, ILabelService)),
|
|
196
|
-
( __param(3, IConfigurationService))
|
|
197
|
-
], ResultCodeEditorView));
|
|
172
|
+
ResultCodeEditorView = ( (__decorate([
|
|
173
|
+
( (__param(1, IInstantiationService))),
|
|
174
|
+
( (__param(2, ILabelService))),
|
|
175
|
+
( (__param(3, IConfigurationService)))
|
|
176
|
+
], ResultCodeEditorView)));
|
|
198
177
|
|
|
199
178
|
export { ResultCodeEditorView };
|
|
@@ -10,6 +10,7 @@ import 'vscode/vscode/vs/base/common/observableInternal/derived';
|
|
|
10
10
|
import { autorunWithStore, autorun } from 'vscode/vscode/vs/base/common/observableInternal/autorun';
|
|
11
11
|
import 'vscode/vscode/vs/base/common/observableInternal/utils';
|
|
12
12
|
import 'vscode/vscode/vs/base/common/cancellation';
|
|
13
|
+
import 'vscode/vscode/vs/base/common/arrays';
|
|
13
14
|
import { isEqual, basename } from 'vscode/vscode/vs/base/common/resources';
|
|
14
15
|
import { isDefined } from 'vscode/vscode/vs/base/common/types';
|
|
15
16
|
import './media/mergeEditor.css.js';
|
|
@@ -45,6 +46,7 @@ import { ResultCodeEditorView } from './editors/resultCodeEditorView.js';
|
|
|
45
46
|
import { AbstractTextEditor } from 'vscode/vscode/vs/workbench/browser/parts/editor/textEditor';
|
|
46
47
|
|
|
47
48
|
var MergeEditor_1, MergeEditorLayoutStore_1;
|
|
49
|
+
const _moduleId = "vs/workbench/contrib/mergeEditor/browser/view/mergeEditor";
|
|
48
50
|
let MergeEditor = class MergeEditor extends AbstractTextEditor {
|
|
49
51
|
static { MergeEditor_1 = this; }
|
|
50
52
|
static { this.ID = 'mergeEditor'; }
|
|
@@ -66,9 +68,9 @@ let MergeEditor = class MergeEditor extends AbstractTextEditor {
|
|
|
66
68
|
this._configurationService = _configurationService;
|
|
67
69
|
this._codeEditorService = _codeEditorService;
|
|
68
70
|
this.configurationService = configurationService;
|
|
69
|
-
this._sessionDisposables = ( new DisposableStore());
|
|
71
|
+
this._sessionDisposables = ( (new DisposableStore()));
|
|
70
72
|
this._viewModel = observableValue(this, undefined);
|
|
71
|
-
this._grid = this._register(( new MutableDisposable()));
|
|
73
|
+
this._grid = this._register(( (new MutableDisposable())));
|
|
72
74
|
this.input1View = this._register(this.instantiationService.createInstance(InputCodeEditorView, 1, this._viewModel));
|
|
73
75
|
this.baseView = observableValue(this, undefined);
|
|
74
76
|
this.baseViewOptions = observableValue(this, undefined);
|
|
@@ -84,23 +86,23 @@ let MergeEditor = class MergeEditor extends AbstractTextEditor {
|
|
|
84
86
|
this._ctxBaseUri = ctxMergeBaseUri.bindTo(this.contextKeyService);
|
|
85
87
|
this._ctxShowNonConflictingChanges = ctxMergeEditorShowNonConflictingChanges.bindTo(this.contextKeyService);
|
|
86
88
|
this._inputModel = observableValue(this, undefined);
|
|
87
|
-
this.viewZoneComputer = ( new ViewZoneComputer(
|
|
89
|
+
this.viewZoneComputer = ( (new ViewZoneComputer(
|
|
88
90
|
this.input1View.editor,
|
|
89
91
|
this.input2View.editor,
|
|
90
92
|
this.inputResultView.editor
|
|
91
|
-
));
|
|
93
|
+
)));
|
|
92
94
|
this.codeLensesVisible = observableConfigValue('mergeEditor.showCodeLenses', true, this.configurationService);
|
|
93
|
-
this.scrollSynchronizer = this._register(( new ScrollSynchronizer(
|
|
95
|
+
this.scrollSynchronizer = this._register(( (new ScrollSynchronizer(
|
|
94
96
|
this._viewModel,
|
|
95
97
|
this.input1View,
|
|
96
98
|
this.input2View,
|
|
97
99
|
this.baseView,
|
|
98
100
|
this.inputResultView,
|
|
99
101
|
this._layoutModeObs
|
|
100
|
-
)));
|
|
101
|
-
this._onDidChangeSizeConstraints = ( new Emitter());
|
|
102
|
+
))));
|
|
103
|
+
this._onDidChangeSizeConstraints = ( (new Emitter()));
|
|
102
104
|
this.onDidChangeSizeConstraints = this._onDidChangeSizeConstraints.event;
|
|
103
|
-
this.baseViewDisposables = this._register(( new DisposableStore()));
|
|
105
|
+
this.baseViewDisposables = this._register(( (new DisposableStore())));
|
|
104
106
|
this.showNonConflictingChangesStore = this.instantiationService.createInstance((PersistentStore), 'mergeEditor/showNonConflictingChanges');
|
|
105
107
|
this.showNonConflictingChanges = observableValue(this, this.showNonConflictingChangesStore.get() ?? false);
|
|
106
108
|
}
|
|
@@ -120,11 +122,7 @@ let MergeEditor = class MergeEditor extends AbstractTextEditor {
|
|
|
120
122
|
if (this.input) {
|
|
121
123
|
return this.input.getName();
|
|
122
124
|
}
|
|
123
|
-
return ( localizeWithPath(
|
|
124
|
-
'vs/workbench/contrib/mergeEditor/browser/view/mergeEditor',
|
|
125
|
-
'mergeEditor',
|
|
126
|
-
"Text Merge Editor"
|
|
127
|
-
));
|
|
125
|
+
return ( localizeWithPath(_moduleId, 0, "Text Merge Editor"));
|
|
128
126
|
}
|
|
129
127
|
createEditorControl(parent, initialOptions) {
|
|
130
128
|
this.rootHtmlElement = parent;
|
|
@@ -155,7 +153,7 @@ let MergeEditor = class MergeEditor extends AbstractTextEditor {
|
|
|
155
153
|
}
|
|
156
154
|
async setInput(input, options, context, token) {
|
|
157
155
|
if (!(input instanceof MergeEditorInput)) {
|
|
158
|
-
throw new BugIndicatingError('ONLY MergeEditorInput is supported');
|
|
156
|
+
throw ( (new BugIndicatingError('ONLY MergeEditorInput is supported')));
|
|
159
157
|
}
|
|
160
158
|
await super.setInput(input, options, context, token);
|
|
161
159
|
this._sessionDisposables.clear();
|
|
@@ -178,8 +176,8 @@ let MergeEditor = class MergeEditor extends AbstractTextEditor {
|
|
|
178
176
|
this._inputModel.set(inputModel, tx);
|
|
179
177
|
});
|
|
180
178
|
this._sessionDisposables.add(viewModel);
|
|
181
|
-
this._ctxResultUri.set(( inputModel.resultUri.toString()));
|
|
182
|
-
this._ctxBaseUri.set(( model.base.uri.toString()));
|
|
179
|
+
this._ctxResultUri.set(( (inputModel.resultUri.toString())));
|
|
180
|
+
this._ctxBaseUri.set(( (model.base.uri.toString())));
|
|
183
181
|
this._sessionDisposables.add(toDisposable(() => {
|
|
184
182
|
this._ctxBaseUri.reset();
|
|
185
183
|
this._ctxResultUri.reset();
|
|
@@ -238,7 +236,7 @@ let MergeEditor = class MergeEditor extends AbstractTextEditor {
|
|
|
238
236
|
const that = this;
|
|
239
237
|
this._sessionDisposables.add(new (class {
|
|
240
238
|
constructor() {
|
|
241
|
-
this._disposable = ( new DisposableStore());
|
|
239
|
+
this._disposable = ( (new DisposableStore()));
|
|
242
240
|
for (const model of this.baseInput1Input2()) {
|
|
243
241
|
this._disposable.add(model.onDidChangeContent(() => this._checkBaseInput1Input2AllEmpty()));
|
|
244
242
|
}
|
|
@@ -272,7 +270,7 @@ let MergeEditor = class MergeEditor extends AbstractTextEditor {
|
|
|
272
270
|
shouldAlignBase,
|
|
273
271
|
shouldAlignResult,
|
|
274
272
|
});
|
|
275
|
-
const disposableStore = ( new DisposableStore());
|
|
273
|
+
const disposableStore = ( (new DisposableStore()));
|
|
276
274
|
if (baseViewZoneAccessor) {
|
|
277
275
|
for (const v of viewZones.baseViewZones) {
|
|
278
276
|
v.create(baseViewZoneAccessor, baseViewZoneIds, disposableStore);
|
|
@@ -511,20 +509,20 @@ let MergeEditor = class MergeEditor extends AbstractTextEditor {
|
|
|
511
509
|
this._ctxShowNonConflictingChanges.set(this.showNonConflictingChanges.get());
|
|
512
510
|
}
|
|
513
511
|
};
|
|
514
|
-
MergeEditor = MergeEditor_1 = ( __decorate([
|
|
515
|
-
( __param(1, IInstantiationService)),
|
|
516
|
-
( __param(2, IContextKeyService)),
|
|
517
|
-
( __param(3, ITelemetryService)),
|
|
518
|
-
( __param(4, IStorageService)),
|
|
519
|
-
( __param(5, IThemeService)),
|
|
520
|
-
( __param(6, ITextResourceConfigurationService)),
|
|
521
|
-
( __param(7, IConfigurationService)),
|
|
522
|
-
( __param(8, IEditorService)),
|
|
523
|
-
( __param(9, IEditorGroupsService)),
|
|
524
|
-
( __param(10, IFileService)),
|
|
525
|
-
( __param(11, ICodeEditorService)),
|
|
526
|
-
( __param(12, IConfigurationService))
|
|
527
|
-
], MergeEditor));
|
|
512
|
+
MergeEditor = MergeEditor_1 = ( (__decorate([
|
|
513
|
+
( (__param(1, IInstantiationService))),
|
|
514
|
+
( (__param(2, IContextKeyService))),
|
|
515
|
+
( (__param(3, ITelemetryService))),
|
|
516
|
+
( (__param(4, IStorageService))),
|
|
517
|
+
( (__param(5, IThemeService))),
|
|
518
|
+
( (__param(6, ITextResourceConfigurationService))),
|
|
519
|
+
( (__param(7, IConfigurationService))),
|
|
520
|
+
( (__param(8, IEditorService))),
|
|
521
|
+
( (__param(9, IEditorGroupsService))),
|
|
522
|
+
( (__param(10, IFileService))),
|
|
523
|
+
( (__param(11, ICodeEditorService))),
|
|
524
|
+
( (__param(12, IConfigurationService)))
|
|
525
|
+
], MergeEditor)));
|
|
528
526
|
let MergeEditorLayoutStore = class MergeEditorLayoutStore {
|
|
529
527
|
static { MergeEditorLayoutStore_1 = this; }
|
|
530
528
|
static { this._key = 'mergeEditor/layout'; }
|
|
@@ -554,9 +552,9 @@ let MergeEditorLayoutStore = class MergeEditorLayoutStore {
|
|
|
554
552
|
}
|
|
555
553
|
}
|
|
556
554
|
};
|
|
557
|
-
MergeEditorLayoutStore = MergeEditorLayoutStore_1 = ( __decorate([
|
|
558
|
-
( __param(0, IStorageService))
|
|
559
|
-
], MergeEditorLayoutStore));
|
|
555
|
+
MergeEditorLayoutStore = MergeEditorLayoutStore_1 = ( (__decorate([
|
|
556
|
+
( (__param(0, IStorageService)))
|
|
557
|
+
], MergeEditorLayoutStore)));
|
|
560
558
|
let MergeEditorOpenHandlerContribution = class MergeEditorOpenHandlerContribution extends Disposable {
|
|
561
559
|
constructor(_editorService, codeEditorService) {
|
|
562
560
|
super();
|
|
@@ -578,10 +576,10 @@ let MergeEditorOpenHandlerContribution = class MergeEditorOpenHandlerContributio
|
|
|
578
576
|
return null;
|
|
579
577
|
}
|
|
580
578
|
};
|
|
581
|
-
MergeEditorOpenHandlerContribution = ( __decorate([
|
|
582
|
-
( __param(0, IEditorService)),
|
|
583
|
-
( __param(1, ICodeEditorService))
|
|
584
|
-
], MergeEditorOpenHandlerContribution));
|
|
579
|
+
MergeEditorOpenHandlerContribution = ( (__decorate([
|
|
580
|
+
( (__param(0, IEditorService))),
|
|
581
|
+
( (__param(1, ICodeEditorService)))
|
|
582
|
+
], MergeEditorOpenHandlerContribution)));
|
|
585
583
|
let MergeEditorResolverContribution = class MergeEditorResolverContribution extends Disposable {
|
|
586
584
|
static { this.ID = 'workbench.contrib.mergeEditorResolver'; }
|
|
587
585
|
constructor(editorResolverService, instantiationService) {
|
|
@@ -611,9 +609,9 @@ let MergeEditorResolverContribution = class MergeEditorResolverContribution exte
|
|
|
611
609
|
}));
|
|
612
610
|
}
|
|
613
611
|
};
|
|
614
|
-
MergeEditorResolverContribution = ( __decorate([
|
|
615
|
-
( __param(0, IEditorResolverService)),
|
|
616
|
-
( __param(1, IInstantiationService))
|
|
617
|
-
], MergeEditorResolverContribution));
|
|
612
|
+
MergeEditorResolverContribution = ( (__decorate([
|
|
613
|
+
( (__param(0, IEditorResolverService))),
|
|
614
|
+
( (__param(1, IInstantiationService)))
|
|
615
|
+
], MergeEditorResolverContribution)));
|
|
618
616
|
|
|
619
617
|
export { MergeEditor, MergeEditorOpenHandlerContribution, MergeEditorResolverContribution };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
2
|
+
import 'vscode/vscode/vs/base/common/arrays';
|
|
2
3
|
import 'vscode/vscode/vs/base/common/observableInternal/derived';
|
|
3
4
|
import { autorunWithStore } from 'vscode/vscode/vs/base/common/observableInternal/autorun';
|
|
4
5
|
import 'vscode/vscode/vs/base/common/observableInternal/utils';
|
|
5
6
|
import 'vscode/vscode/vs/base/common/cancellation';
|
|
6
7
|
import { DocumentLineRangeMap } from 'vscode/vscode/vs/workbench/contrib/mergeEditor/browser/model/mapping';
|
|
7
|
-
import { ReentrancyBarrier } from 'vscode/vscode/vs/
|
|
8
|
+
import { ReentrancyBarrier } from 'vscode/vscode/vs/base/common/controlFlow';
|
|
8
9
|
|
|
9
10
|
class ScrollSynchronizer extends Disposable {
|
|
10
11
|
get model() { return this.viewModel.get()?.model; }
|
|
@@ -42,7 +43,7 @@ class ScrollSynchronizer extends Disposable {
|
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
};
|
|
45
|
-
this._store.add(this.input1View.editor.onDidScrollChange(this.reentrancyBarrier.
|
|
46
|
+
this._store.add(this.input1View.editor.onDidScrollChange(this.reentrancyBarrier.makeExclusiveOrSkip((c) => {
|
|
46
47
|
if (c.scrollTopChanged) {
|
|
47
48
|
handleInput1OnScroll();
|
|
48
49
|
}
|
|
@@ -52,7 +53,7 @@ class ScrollSynchronizer extends Disposable {
|
|
|
52
53
|
this.inputResultView.editor.setScrollLeft(c.scrollLeft, 1 );
|
|
53
54
|
}
|
|
54
55
|
})));
|
|
55
|
-
this._store.add(this.input2View.editor.onDidScrollChange(this.reentrancyBarrier.
|
|
56
|
+
this._store.add(this.input2View.editor.onDidScrollChange(this.reentrancyBarrier.makeExclusiveOrSkip((c) => {
|
|
56
57
|
if (!this.model) {
|
|
57
58
|
return;
|
|
58
59
|
}
|
|
@@ -82,7 +83,7 @@ class ScrollSynchronizer extends Disposable {
|
|
|
82
83
|
this.inputResultView.editor.setScrollLeft(c.scrollLeft, 1 );
|
|
83
84
|
}
|
|
84
85
|
})));
|
|
85
|
-
this._store.add(this.inputResultView.editor.onDidScrollChange(this.reentrancyBarrier.
|
|
86
|
+
this._store.add(this.inputResultView.editor.onDidScrollChange(this.reentrancyBarrier.makeExclusiveOrSkip((c) => {
|
|
86
87
|
if (c.scrollTopChanged) {
|
|
87
88
|
if (this.shouldAlignResult) {
|
|
88
89
|
this.input1View.editor.setScrollTop(c.scrollTop, 1 );
|
|
@@ -109,7 +110,7 @@ class ScrollSynchronizer extends Disposable {
|
|
|
109
110
|
this._store.add(autorunWithStore((reader, store) => {
|
|
110
111
|
const baseView = this.baseView.read(reader);
|
|
111
112
|
if (baseView) {
|
|
112
|
-
store.add(baseView.editor.onDidScrollChange(this.reentrancyBarrier.
|
|
113
|
+
store.add(baseView.editor.onDidScrollChange(this.reentrancyBarrier.makeExclusiveOrSkip((c) => {
|
|
113
114
|
if (c.scrollTopChanged) {
|
|
114
115
|
if (!this.model) {
|
|
115
116
|
return;
|
|
@@ -6,6 +6,7 @@ import { derived } from 'vscode/vscode/vs/base/common/observableInternal/derived
|
|
|
6
6
|
import 'vscode/vscode/vs/base/common/observableInternal/autorun';
|
|
7
7
|
import { derivedObservableWithWritableCache } from 'vscode/vscode/vs/base/common/observableInternal/utils';
|
|
8
8
|
import 'vscode/vscode/vs/base/common/cancellation';
|
|
9
|
+
import 'vscode/vscode/vs/base/common/arrays';
|
|
9
10
|
import { Range } from 'vscode/vscode/vs/editor/common/core/range';
|
|
10
11
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
11
12
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
@@ -13,6 +14,7 @@ import { INotificationService } from 'vscode/vscode/vs/platform/notification/com
|
|
|
13
14
|
import { LineRange } from 'vscode/vscode/vs/workbench/contrib/mergeEditor/browser/model/lineRange';
|
|
14
15
|
import { observableConfigValue } from 'vscode/vscode/vs/workbench/contrib/mergeEditor/browser/utils';
|
|
15
16
|
|
|
17
|
+
const _moduleId = "vs/workbench/contrib/mergeEditor/browser/view/viewModel";
|
|
16
18
|
let MergeEditorViewModel = class MergeEditorViewModel extends Disposable {
|
|
17
19
|
constructor(model, inputCodeEditorView1, inputCodeEditorView2, resultCodeEditorView, baseCodeEditorView, showNonConflictingChanges, configurationService, notificationService) {
|
|
18
20
|
super();
|
|
@@ -25,7 +27,7 @@ let MergeEditorViewModel = class MergeEditorViewModel extends Disposable {
|
|
|
25
27
|
this.configurationService = configurationService;
|
|
26
28
|
this.notificationService = notificationService;
|
|
27
29
|
this.manuallySetActiveModifiedBaseRange = observableValue(this, { range: undefined, counter: 0 });
|
|
28
|
-
this.attachedHistory = this._register(( new AttachedHistory(this.model.resultTextModel)));
|
|
30
|
+
this.attachedHistory = this._register(( (new AttachedHistory(this.model.resultTextModel))));
|
|
29
31
|
this.shouldUseAppendInsteadOfAccept = observableConfigValue('mergeEditor.shouldUseAppendInsteadOfAccept', false, this.configurationService);
|
|
30
32
|
this.counter = 0;
|
|
31
33
|
this.lastFocusedEditor = derivedObservableWithWritableCache(this, (reader, lastValue) => {
|
|
@@ -54,7 +56,7 @@ let MergeEditorViewModel = class MergeEditorViewModel extends Disposable {
|
|
|
54
56
|
return undefined;
|
|
55
57
|
}
|
|
56
58
|
const selections = sourceEditor.selection.read(reader) || [];
|
|
57
|
-
const rangesInBase = ( selections.map((selection) => {
|
|
59
|
+
const rangesInBase = ( (selections.map((selection) => {
|
|
58
60
|
if (sourceEditor === this.inputCodeEditorView1) {
|
|
59
61
|
return this.model.translateInputRangeToBase(1, selection);
|
|
60
62
|
}
|
|
@@ -70,7 +72,7 @@ let MergeEditorViewModel = class MergeEditorViewModel extends Disposable {
|
|
|
70
72
|
else {
|
|
71
73
|
return selection;
|
|
72
74
|
}
|
|
73
|
-
}));
|
|
75
|
+
})));
|
|
74
76
|
return {
|
|
75
77
|
rangesInBase,
|
|
76
78
|
sourceEditor
|
|
@@ -104,10 +106,10 @@ let MergeEditorViewModel = class MergeEditorViewModel extends Disposable {
|
|
|
104
106
|
const baseRangeStates = [];
|
|
105
107
|
for (const change of e.changes) {
|
|
106
108
|
const rangeInBase = this.model.translateResultRangeToBase(Range.lift(change.range));
|
|
107
|
-
const baseRanges = this.model.findModifiedBaseRangesInRange(( new LineRange(
|
|
109
|
+
const baseRanges = this.model.findModifiedBaseRangesInRange(( (new LineRange(
|
|
108
110
|
rangeInBase.startLineNumber,
|
|
109
111
|
rangeInBase.endLineNumber - rangeInBase.startLineNumber
|
|
110
|
-
)));
|
|
112
|
+
))));
|
|
111
113
|
if (baseRanges.length === 1) {
|
|
112
114
|
const isHandled = this.model.isHandled(baseRanges[0]).get();
|
|
113
115
|
if (!isHandled) {
|
|
@@ -204,8 +206,8 @@ let MergeEditorViewModel = class MergeEditorViewModel extends Disposable {
|
|
|
204
206
|
const activeModifiedBaseRange = this.activeModifiedBaseRange.get();
|
|
205
207
|
if (!activeModifiedBaseRange) {
|
|
206
208
|
this.notificationService.error(( localizeWithPath(
|
|
207
|
-
|
|
208
|
-
|
|
209
|
+
_moduleId,
|
|
210
|
+
0,
|
|
209
211
|
"There is currently no conflict focused that can be toggled."
|
|
210
212
|
)));
|
|
211
213
|
return;
|
|
@@ -222,10 +224,10 @@ let MergeEditorViewModel = class MergeEditorViewModel extends Disposable {
|
|
|
222
224
|
});
|
|
223
225
|
}
|
|
224
226
|
};
|
|
225
|
-
MergeEditorViewModel = ( __decorate([
|
|
226
|
-
( __param(6, IConfigurationService)),
|
|
227
|
-
( __param(7, INotificationService))
|
|
228
|
-
], MergeEditorViewModel));
|
|
227
|
+
MergeEditorViewModel = ( (__decorate([
|
|
228
|
+
( (__param(6, IConfigurationService))),
|
|
229
|
+
( (__param(7, INotificationService)))
|
|
230
|
+
], MergeEditorViewModel)));
|
|
229
231
|
class AttachedHistory extends Disposable {
|
|
230
232
|
constructor(model) {
|
|
231
233
|
super();
|