@codingame/monaco-vscode-view-common-service-override 5.3.0 → 6.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.
Files changed (72) hide show
  1. package/package.json +3 -3
  2. package/viewCommon.js +1 -1
  3. package/vscode/src/vs/base/browser/ui/centered/centeredViewLayout.js +2 -1
  4. package/vscode/src/vs/base/browser/ui/grid/grid.js +34 -24
  5. package/vscode/src/vs/base/browser/ui/grid/gridview.js +35 -34
  6. package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +9 -60
  7. package/vscode/src/vs/workbench/browser/actions/listCommands.js +119 -79
  8. package/vscode/src/vs/workbench/browser/actions/navigationActions.js +76 -64
  9. package/vscode/src/vs/workbench/browser/media/style.css.js +1 -1
  10. package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +51 -71
  11. package/vscode/src/vs/workbench/browser/parts/activitybar/media/activityaction.css.js +1 -1
  12. package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +21 -18
  13. package/vscode/src/vs/workbench/browser/parts/compositeBar.js +6 -6
  14. package/vscode/src/vs/workbench/browser/parts/compositePart.js +11 -8
  15. package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +8 -7
  16. package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +112 -107
  17. package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +2 -2
  18. package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +36 -30
  19. package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +75 -69
  20. package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +143 -25
  21. package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +20 -16
  22. package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +13 -11
  23. package/vscode/src/vs/workbench/browser/parts/paneCompositePartService.js +5 -4
  24. package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +8 -5
  25. package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarActions.js +9 -6
  26. package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +51 -37
  27. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +28 -25
  28. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +23 -13
  29. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +5 -5
  30. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js +3 -2
  31. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +2 -1
  32. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +34 -23
  33. package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +3 -2
  34. package/vscode/src/vs/workbench/contrib/customEditor/common/customEditor.js +7 -1
  35. package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +3 -2
  36. package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.js +1 -0
  37. package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +17 -15
  38. package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.js +2 -1
  39. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +2 -1
  40. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +4 -3
  41. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +7 -7
  42. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +2 -2
  43. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +2 -1
  44. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +9 -8
  45. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +2 -2
  46. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +11 -6
  47. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +24 -23
  48. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +3 -2
  49. package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.js +5 -4
  50. package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.js +2 -1
  51. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +26 -23
  52. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +23 -13
  53. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +5 -5
  54. package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.js +2 -2
  55. package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +7 -6
  56. package/vscode/src/vs/workbench/contrib/webview/browser/webviewService.js +8 -6
  57. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +10 -8
  58. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +3 -2
  59. package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +4 -3
  60. package/vscode/src/vs/workbench/services/activity/browser/activityService.js +1 -0
  61. package/vscode/src/vs/workbench/services/editor/browser/editorPaneService.js +1 -0
  62. package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +21 -19
  63. package/vscode/src/vs/workbench/services/history/browser/historyService.js +73 -63
  64. package/vscode/src/vs/workbench/services/progress/browser/progressService.js +19 -15
  65. package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.js +1 -0
  66. package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +23 -18
  67. package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +20 -14
  68. package/vscode/src/vs/base/browser/deviceAccess.js +0 -61
  69. package/vscode/src/vs/platform/languagePacks/common/localizedStrings.js +0 -13
  70. package/vscode/src/vs/workbench/browser/window.js +0 -330
  71. package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +0 -371
  72. package/vscode/src/vs/workbench/services/driver/browser/driver.js +0 -188
@@ -4,6 +4,7 @@ import 'vscode/vscode/vs/base/common/observableInternal/derived';
4
4
  import { autorunWithStore } from 'vscode/vscode/vs/base/common/observableInternal/autorun';
5
5
  import 'vscode/vscode/vs/base/common/observableInternal/utils';
6
6
  import 'vscode/vscode/vs/base/common/cancellation';
7
+ import { ScrollType } from 'vscode/vscode/vs/editor/common/editorCommon';
7
8
  import { DocumentLineRangeMap } from 'vscode/vscode/vs/workbench/contrib/mergeEditor/browser/model/mapping';
8
9
  import { ReentrancyBarrier } from 'vscode/vscode/vs/base/common/controlFlow';
9
10
 
@@ -24,9 +25,9 @@ class ScrollSynchronizer extends Disposable {
24
25
  if (!this.model) {
25
26
  return;
26
27
  }
27
- this.input2View.editor.setScrollTop(this.input1View.editor.getScrollTop(), 1 );
28
+ this.input2View.editor.setScrollTop(this.input1View.editor.getScrollTop(), ScrollType.Immediate);
28
29
  if (this.shouldAlignResult) {
29
- this.inputResultView.editor.setScrollTop(this.input1View.editor.getScrollTop(), 1 );
30
+ this.inputResultView.editor.setScrollTop(this.input1View.editor.getScrollTop(), ScrollType.Immediate);
30
31
  }
31
32
  else {
32
33
  const mappingInput1Result = this.model.input1ResultMapping.get();
@@ -35,7 +36,7 @@ class ScrollSynchronizer extends Disposable {
35
36
  const baseView = this.baseView.get();
36
37
  if (baseView) {
37
38
  if (this.shouldAlignBase) {
38
- this.baseView.get()?.editor.setScrollTop(this.input1View.editor.getScrollTop(), 1 );
39
+ this.baseView.get()?.editor.setScrollTop(this.input1View.editor.getScrollTop(), ScrollType.Immediate);
39
40
  }
40
41
  else {
41
42
  const mapping = ( new DocumentLineRangeMap(this.model.baseInput1Diffs.get(), -1)).reverse();
@@ -48,9 +49,9 @@ class ScrollSynchronizer extends Disposable {
48
49
  handleInput1OnScroll();
49
50
  }
50
51
  if (c.scrollLeftChanged) {
51
- this.baseView.get()?.editor.setScrollLeft(c.scrollLeft, 1 );
52
- this.input2View.editor.setScrollLeft(c.scrollLeft, 1 );
53
- this.inputResultView.editor.setScrollLeft(c.scrollLeft, 1 );
52
+ this.baseView.get()?.editor.setScrollLeft(c.scrollLeft, ScrollType.Immediate);
53
+ this.input2View.editor.setScrollLeft(c.scrollLeft, ScrollType.Immediate);
54
+ this.inputResultView.editor.setScrollLeft(c.scrollLeft, ScrollType.Immediate);
54
55
  }
55
56
  })));
56
57
  this._store.add(this.input2View.editor.onDidScrollChange(this.reentrancyBarrier.makeExclusiveOrSkip((c) => {
@@ -58,9 +59,9 @@ class ScrollSynchronizer extends Disposable {
58
59
  return;
59
60
  }
60
61
  if (c.scrollTopChanged) {
61
- this.input1View.editor.setScrollTop(c.scrollTop, 1 );
62
+ this.input1View.editor.setScrollTop(c.scrollTop, ScrollType.Immediate);
62
63
  if (this.shouldAlignResult) {
63
- this.inputResultView.editor.setScrollTop(this.input2View.editor.getScrollTop(), 1 );
64
+ this.inputResultView.editor.setScrollTop(this.input2View.editor.getScrollTop(), ScrollType.Immediate);
64
65
  }
65
66
  else {
66
67
  const mappingInput2Result = this.model.input2ResultMapping.get();
@@ -69,7 +70,7 @@ class ScrollSynchronizer extends Disposable {
69
70
  const baseView = this.baseView.get();
70
71
  if (baseView && this.model) {
71
72
  if (this.shouldAlignBase) {
72
- this.baseView.get()?.editor.setScrollTop(c.scrollTop, 1 );
73
+ this.baseView.get()?.editor.setScrollTop(c.scrollTop, ScrollType.Immediate);
73
74
  }
74
75
  else {
75
76
  const mapping = ( new DocumentLineRangeMap(this.model.baseInput2Diffs.get(), -1)).reverse();
@@ -78,16 +79,16 @@ class ScrollSynchronizer extends Disposable {
78
79
  }
79
80
  }
80
81
  if (c.scrollLeftChanged) {
81
- this.baseView.get()?.editor.setScrollLeft(c.scrollLeft, 1 );
82
- this.input1View.editor.setScrollLeft(c.scrollLeft, 1 );
83
- this.inputResultView.editor.setScrollLeft(c.scrollLeft, 1 );
82
+ this.baseView.get()?.editor.setScrollLeft(c.scrollLeft, ScrollType.Immediate);
83
+ this.input1View.editor.setScrollLeft(c.scrollLeft, ScrollType.Immediate);
84
+ this.inputResultView.editor.setScrollLeft(c.scrollLeft, ScrollType.Immediate);
84
85
  }
85
86
  })));
86
87
  this._store.add(this.inputResultView.editor.onDidScrollChange(this.reentrancyBarrier.makeExclusiveOrSkip((c) => {
87
88
  if (c.scrollTopChanged) {
88
89
  if (this.shouldAlignResult) {
89
- this.input1View.editor.setScrollTop(c.scrollTop, 1 );
90
- this.input2View.editor.setScrollTop(c.scrollTop, 1 );
90
+ this.input1View.editor.setScrollTop(c.scrollTop, ScrollType.Immediate);
91
+ this.input2View.editor.setScrollTop(c.scrollTop, ScrollType.Immediate);
91
92
  }
92
93
  else {
93
94
  const mapping1 = this.model?.resultInput1Mapping.get();
@@ -102,9 +103,9 @@ class ScrollSynchronizer extends Disposable {
102
103
  }
103
104
  }
104
105
  if (c.scrollLeftChanged) {
105
- this.baseView.get()?.editor?.setScrollLeft(c.scrollLeft, 1 );
106
- this.input1View.editor.setScrollLeft(c.scrollLeft, 1 );
107
- this.input2View.editor.setScrollLeft(c.scrollLeft, 1 );
106
+ this.baseView.get()?.editor?.setScrollLeft(c.scrollLeft, ScrollType.Immediate);
107
+ this.input1View.editor.setScrollLeft(c.scrollLeft, ScrollType.Immediate);
108
+ this.input2View.editor.setScrollLeft(c.scrollLeft, ScrollType.Immediate);
108
109
  }
109
110
  })));
110
111
  this._store.add(autorunWithStore((reader, store) => {
@@ -116,8 +117,8 @@ class ScrollSynchronizer extends Disposable {
116
117
  return;
117
118
  }
118
119
  if (this.shouldAlignBase) {
119
- this.input1View.editor.setScrollTop(c.scrollTop, 1 );
120
- this.input2View.editor.setScrollTop(c.scrollTop, 1 );
120
+ this.input1View.editor.setScrollTop(c.scrollTop, ScrollType.Immediate);
121
+ this.input2View.editor.setScrollTop(c.scrollTop, ScrollType.Immediate);
121
122
  }
122
123
  else {
123
124
  const baseInput1Mapping = ( new DocumentLineRangeMap(this.model.baseInput1Diffs.get(), -1));
@@ -129,9 +130,9 @@ class ScrollSynchronizer extends Disposable {
129
130
  this.synchronizeScrolling(baseView.editor, this.inputResultView.editor, baseMapping);
130
131
  }
131
132
  if (c.scrollLeftChanged) {
132
- this.inputResultView.editor.setScrollLeft(c.scrollLeft, 1 );
133
- this.input1View.editor.setScrollLeft(c.scrollLeft, 1 );
134
- this.input2View.editor.setScrollLeft(c.scrollLeft, 1 );
133
+ this.inputResultView.editor.setScrollLeft(c.scrollLeft, ScrollType.Immediate);
134
+ this.input1View.editor.setScrollLeft(c.scrollLeft, ScrollType.Immediate);
135
+ this.input2View.editor.setScrollLeft(c.scrollLeft, ScrollType.Immediate);
135
136
  }
136
137
  })));
137
138
  }
@@ -155,7 +156,7 @@ class ScrollSynchronizer extends Disposable {
155
156
  const sourceEndPx = scrollingEditor.getTopForLineNumber(sourceRange.endLineNumberExclusive);
156
157
  const factor = Math.min((scrollingEditor.getScrollTop() - sourceStartTopPx) / (sourceEndPx - sourceStartTopPx), 1);
157
158
  const resultScrollPosition = resultStartTopPx + (resultEndPx - resultStartTopPx) * factor;
158
- targetEditor.setScrollTop(resultScrollPosition, 1 );
159
+ targetEditor.setScrollTop(resultScrollPosition, ScrollType.Immediate);
159
160
  }
160
161
  }
161
162
 
@@ -8,11 +8,12 @@ import { derivedObservableWithWritableCache } from 'vscode/vscode/vs/base/common
8
8
  import 'vscode/vscode/vs/base/common/cancellation';
9
9
  import 'vscode/vscode/vs/base/common/arrays';
10
10
  import { Range } from 'vscode/vscode/vs/editor/common/core/range';
11
+ import { ScrollType } from 'vscode/vscode/vs/editor/common/editorCommon';
11
12
  import { localizeWithPath } from 'vscode/vscode/vs/nls';
12
13
  import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
13
14
  import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification.service';
14
15
  import { LineRange } from 'vscode/vscode/vs/workbench/contrib/mergeEditor/browser/model/lineRange';
15
- import { observableConfigValue } from 'vscode/vscode/vs/workbench/contrib/mergeEditor/browser/utils';
16
+ import { observableConfigValue } from 'vscode/vscode/vs/platform/observable/common/platformObservableUtils';
16
17
 
17
18
  const _moduleId = "vs/workbench/contrib/mergeEditor/browser/view/viewModel";
18
19
  let MergeEditorViewModel = class MergeEditorViewModel extends Disposable {
@@ -185,7 +186,7 @@ let MergeEditorViewModel = class MergeEditorViewModel extends Disposable {
185
186
  lineNumber: startLineNumber,
186
187
  column: editor.editor.getModel().getLineFirstNonWhitespaceColumn(startLineNumber),
187
188
  });
188
- editor.editor.revealLinesNearTop(startLineNumber, endLineNumberExclusive, 0 );
189
+ editor.editor.revealLinesNearTop(startLineNumber, endLineNumberExclusive, ScrollType.Smooth);
189
190
  }
190
191
  }
191
192
  goToNextModifiedBaseRange(predicate) {
@@ -1,10 +1,11 @@
1
1
  import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
2
  import { localizeWithPath, localize2WithPath } from 'vscode/vscode/vs/nls';
3
+ import { StatusbarAlignment } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar';
3
4
  import { IStatusbarService } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar.service';
4
5
  import { Disposable, MutableDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
5
6
  import { parseKeyboardLayoutDescription, areKeyboardLayoutsEqual, getKeyboardLayoutId } from 'vscode/vscode/vs/platform/keyboardLayout/common/keyboardLayout';
6
7
  import { IKeyboardLayoutService } from 'vscode/vscode/vs/platform/keyboardLayout/common/keyboardLayout.service';
7
- import { registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
8
+ import { registerWorkbenchContribution2, WorkbenchPhase } from 'vscode/vscode/vs/workbench/common/contributions';
8
9
  import { KEYBOARD_LAYOUT_OPEN_PICKER } from 'vscode/vscode/vs/workbench/contrib/preferences/common/preferences';
9
10
  import { isMacintosh, isWindows } from 'vscode/vscode/vs/base/common/platform';
10
11
  import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service';
@@ -33,7 +34,7 @@ let KeyboardLayoutPickerContribution = class KeyboardLayoutPickerContribution ex
33
34
  text,
34
35
  ariaLabel: text,
35
36
  command: KEYBOARD_LAYOUT_OPEN_PICKER
36
- }, 'status.workbench.keyboardLayout', 1 );
37
+ }, 'status.workbench.keyboardLayout', StatusbarAlignment.RIGHT);
37
38
  }
38
39
  this._register(this.keyboardLayoutService.onDidChangeKeyboardLayout(() => {
39
40
  const layout = this.keyboardLayoutService.getCurrentKeyboardLayout();
@@ -54,7 +55,7 @@ let KeyboardLayoutPickerContribution = class KeyboardLayoutPickerContribution ex
54
55
  text,
55
56
  ariaLabel: text,
56
57
  command: KEYBOARD_LAYOUT_OPEN_PICKER
57
- }, 'status.workbench.keyboardLayout', 1 );
58
+ }, 'status.workbench.keyboardLayout', StatusbarAlignment.RIGHT);
58
59
  }
59
60
  }));
60
61
  }
@@ -63,7 +64,7 @@ KeyboardLayoutPickerContribution = ( (__decorate([
63
64
  ( (__param(0, IKeyboardLayoutService))),
64
65
  ( (__param(1, IStatusbarService)))
65
66
  ], KeyboardLayoutPickerContribution)));
66
- registerWorkbenchContribution2(KeyboardLayoutPickerContribution.ID, KeyboardLayoutPickerContribution, 1 );
67
+ registerWorkbenchContribution2(KeyboardLayoutPickerContribution.ID, KeyboardLayoutPickerContribution, WorkbenchPhase.BlockStartup);
67
68
  const DEFAULT_CONTENT = [
68
69
  `// ${( localizeWithPath(
69
70
  _moduleId,
@@ -1,5 +1,6 @@
1
1
  import { localizeWithPath } from 'vscode/vscode/vs/nls';
2
2
  import { Extensions as Extensions$1 } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
3
+ import { LifecyclePhase } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
3
4
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
4
5
  import { workbenchConfigurationNodeBase } from 'vscode/vscode/vs/workbench/common/configuration';
5
6
  import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
@@ -8,7 +9,7 @@ import { isIOS } from 'vscode/vscode/vs/base/common/platform';
8
9
 
9
10
  const _moduleId = "vs/workbench/contrib/sash/browser/sash.contribution";
10
11
  ( (Registry.as(Extensions.Workbench)))
11
- .registerWorkbenchContribution(SashSettingsController, 3 );
12
+ .registerWorkbenchContribution(SashSettingsController, LifecyclePhase.Restored);
12
13
  ( (Registry.as(Extensions$1.Configuration)))
13
14
  .registerConfiguration({
14
15
  ...workbenchConfigurationNodeBase,
@@ -3,8 +3,9 @@ import { CancellationTokenSource } from 'vscode/vscode/vs/base/common/cancellati
3
3
  import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
4
4
  import { isCancellationError } from 'vscode/vscode/vs/base/common/errors';
5
5
  import { Event } from 'vscode/vscode/vs/base/common/event';
6
+ import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
6
7
  import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
7
- import { registerEditorContribution, EditorAction2 } from 'vscode/vscode/vs/editor/browser/editorExtensions';
8
+ import { registerEditorContribution, EditorContributionInstantiation, EditorAction2 } from 'vscode/vscode/vs/editor/browser/editorExtensions';
8
9
  import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
9
10
  import { Range } from 'vscode/vscode/vs/editor/common/core/range';
10
11
  import { PeekContext } from 'vscode/vscode/vs/editor/contrib/peekView/browser/peekView';
@@ -13,9 +14,11 @@ import { registerAction2, MenuId } from 'vscode/vscode/vs/platform/actions/commo
13
14
  import { RawContextKey, ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
14
15
  import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
15
16
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
17
+ import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
18
+ import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
16
19
  import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
17
20
  import { TypeHierarchyTreePeekWidget } from './typeHierarchyPeek.js';
18
- import { TypeHierarchyProviderRegistry, TypeHierarchyModel } from 'vscode/vscode/vs/workbench/contrib/typeHierarchy/common/typeHierarchy';
21
+ import { TypeHierarchyDirection, TypeHierarchyProviderRegistry, TypeHierarchyModel } from 'vscode/vscode/vs/workbench/contrib/typeHierarchy/common/typeHierarchy';
19
22
 
20
23
  var TypeHierarchyController_1;
21
24
  const _moduleId = "vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution";
@@ -27,9 +30,9 @@ const _ctxTypeHierarchyDirection = ( (new RawContextKey(
27
30
  { type: 'string', description: ( localizeWithPath(_moduleId, 2, 'whether type hierarchy shows super types or subtypes')) }
28
31
  )));
29
32
  function sanitizedDirection(candidate) {
30
- return candidate === "subtypes" || candidate === "supertypes"
33
+ return candidate === TypeHierarchyDirection.Subtypes || candidate === TypeHierarchyDirection.Supertypes
31
34
  ? candidate
32
- : "subtypes" ;
35
+ : TypeHierarchyDirection.Subtypes;
33
36
  }
34
37
  let TypeHierarchyController = class TypeHierarchyController {
35
38
  static { TypeHierarchyController_1 = this; }
@@ -69,7 +72,7 @@ let TypeHierarchyController = class TypeHierarchyController {
69
72
  }
70
73
  const cts = ( (new CancellationTokenSource()));
71
74
  const model = TypeHierarchyModel.create(document, position, cts.token);
72
- const direction = sanitizedDirection(this._storageService.get(TypeHierarchyController_1._storageDirectionKey, 0 , "subtypes" ));
75
+ const direction = sanitizedDirection(this._storageService.get(TypeHierarchyController_1._storageDirectionKey, StorageScope.PROFILE, TypeHierarchyDirection.Subtypes));
73
76
  this._showTypeHierarchyWidget(position, direction, model, cts);
74
77
  }
75
78
  _showTypeHierarchyWidget(position, direction, model, cts) {
@@ -80,7 +83,7 @@ let TypeHierarchyController = class TypeHierarchyController {
80
83
  this._widget.showLoading();
81
84
  this._sessionDisposables.add(this._widget.onDidClose(() => {
82
85
  this.endTypeHierarchy();
83
- this._storageService.store(TypeHierarchyController_1._storageDirectionKey, this._widget.direction, 0 , 0 );
86
+ this._storageService.store(TypeHierarchyController_1._storageDirectionKey, this._widget.direction, StorageScope.PROFILE, StorageTarget.USER);
84
87
  }));
85
88
  this._sessionDisposables.add({ dispose() { cts.dispose(true); } });
86
89
  this._sessionDisposables.add(this._widget);
@@ -121,12 +124,12 @@ let TypeHierarchyController = class TypeHierarchyController {
121
124
  TypeHierarchyController_1.get(newEditor)?._showTypeHierarchyWidget(Range.lift(newModel.root.selectionRange).getStartPosition(), this._widget.direction, Promise.resolve(newModel), ( (new CancellationTokenSource())));
122
125
  }
123
126
  showSupertypes() {
124
- this._widget?.updateDirection("supertypes" );
125
- this._ctxDirection.set("supertypes" );
127
+ this._widget?.updateDirection(TypeHierarchyDirection.Supertypes);
128
+ this._ctxDirection.set(TypeHierarchyDirection.Supertypes);
126
129
  }
127
130
  showSubtypes() {
128
- this._widget?.updateDirection("subtypes" );
129
- this._ctxDirection.set("subtypes" );
131
+ this._widget?.updateDirection(TypeHierarchyDirection.Subtypes);
132
+ this._ctxDirection.set(TypeHierarchyDirection.Subtypes);
130
133
  }
131
134
  endTypeHierarchy() {
132
135
  this._sessionDisposables.clear();
@@ -140,7 +143,7 @@ TypeHierarchyController = TypeHierarchyController_1 = ( (__decorate([
140
143
  ( (__param(3, ICodeEditorService))),
141
144
  ( (__param(4, IInstantiationService)))
142
145
  ], TypeHierarchyController)));
143
- registerEditorContribution(TypeHierarchyController.Id, TypeHierarchyController, 0 );
146
+ registerEditorContribution(TypeHierarchyController.Id, TypeHierarchyController, EditorContributionInstantiation.Eager);
144
147
  registerAction2(class PeekTypeHierarchyAction extends EditorAction2 {
145
148
  constructor() {
146
149
  super({
@@ -168,15 +171,15 @@ registerAction2(class extends EditorAction2 {
168
171
  icon: Codicon.typeHierarchySuper,
169
172
  precondition: ( (ContextKeyExpr.and(
170
173
  _ctxTypeHierarchyVisible,
171
- (_ctxTypeHierarchyDirection.isEqualTo("subtypes" ))
174
+ (_ctxTypeHierarchyDirection.isEqualTo(TypeHierarchyDirection.Subtypes))
172
175
  ))),
173
176
  keybinding: {
174
- weight: 200 ,
175
- primary: 1024 + 512 + 38 ,
177
+ weight: KeybindingWeight.WorkbenchContrib,
178
+ primary: KeyMod.Shift + KeyMod.Alt + KeyCode.KeyH,
176
179
  },
177
180
  menu: {
178
181
  id: TypeHierarchyTreePeekWidget.TitleMenu,
179
- when: ( (_ctxTypeHierarchyDirection.isEqualTo("subtypes" ))),
182
+ when: ( (_ctxTypeHierarchyDirection.isEqualTo(TypeHierarchyDirection.Subtypes))),
180
183
  order: 1,
181
184
  }
182
185
  });
@@ -193,15 +196,15 @@ registerAction2(class extends EditorAction2 {
193
196
  icon: Codicon.typeHierarchySub,
194
197
  precondition: ( (ContextKeyExpr.and(
195
198
  _ctxTypeHierarchyVisible,
196
- (_ctxTypeHierarchyDirection.isEqualTo("supertypes" ))
199
+ (_ctxTypeHierarchyDirection.isEqualTo(TypeHierarchyDirection.Supertypes))
197
200
  ))),
198
201
  keybinding: {
199
- weight: 200 ,
200
- primary: 1024 + 512 + 38 ,
202
+ weight: KeybindingWeight.WorkbenchContrib,
203
+ primary: KeyMod.Shift + KeyMod.Alt + KeyCode.KeyH,
201
204
  },
202
205
  menu: {
203
206
  id: TypeHierarchyTreePeekWidget.TitleMenu,
204
- when: ( (_ctxTypeHierarchyDirection.isEqualTo("supertypes" ))),
207
+ when: ( (_ctxTypeHierarchyDirection.isEqualTo(TypeHierarchyDirection.Supertypes))),
205
208
  order: 1,
206
209
  }
207
210
  });
@@ -217,8 +220,8 @@ registerAction2(class extends EditorAction2 {
217
220
  title: ( localize2WithPath(_moduleId, 8, 'Refocus Type Hierarchy')),
218
221
  precondition: _ctxTypeHierarchyVisible,
219
222
  keybinding: {
220
- weight: 200 ,
221
- primary: 1024 + 3
223
+ weight: KeybindingWeight.WorkbenchContrib,
224
+ primary: KeyMod.Shift + KeyCode.Enter
222
225
  }
223
226
  });
224
227
  }
@@ -234,8 +237,8 @@ registerAction2(class extends EditorAction2 {
234
237
  icon: Codicon.close,
235
238
  precondition: _ctxTypeHierarchyVisible,
236
239
  keybinding: {
237
- weight: 200 + 10,
238
- primary: 9 ,
240
+ weight: KeybindingWeight.WorkbenchContrib + 10,
241
+ primary: KeyCode.Escape,
239
242
  when: ContextKeyExpr.not('config.editor.stablePeek')
240
243
  },
241
244
  menu: {
@@ -8,7 +8,8 @@ import { Event } from 'vscode/vscode/vs/base/common/event';
8
8
  import { DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
9
9
  import { EmbeddedCodeEditorWidget } from 'vscode/vscode/vs/editor/browser/widget/codeEditor/embeddedCodeEditorWidget';
10
10
  import { Range } from 'vscode/vscode/vs/editor/common/core/range';
11
- import { OverviewRulerLane } from 'vscode/vscode/vs/editor/common/model';
11
+ import { ScrollType } from 'vscode/vscode/vs/editor/common/editorCommon';
12
+ import { TrackedRangeStickiness, OverviewRulerLane } from 'vscode/vscode/vs/editor/common/model';
12
13
  import { ITextModelService } from 'vscode/vscode/vs/editor/common/services/resolverService';
13
14
  import { PeekViewWidget, peekViewBorder, peekViewTitleBackground, peekViewTitleForeground, peekViewTitleInfoForeground, peekViewResultsBackground, peekViewEditorMatchHighlight, IPeekViewService } from 'vscode/vscode/vs/editor/contrib/peekView/browser/peekView';
14
15
  import { localizeWithPath } from 'vscode/vscode/vs/nls';
@@ -18,20 +19,29 @@ import { IMenuService } from 'vscode/vscode/vs/platform/actions/common/actions.s
18
19
  import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
19
20
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
20
21
  import { WorkbenchAsyncDataTree } from 'vscode/vscode/vs/platform/list/browser/listService';
22
+ import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
21
23
  import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
22
24
  import { themeColorFromId } from 'vscode/vscode/vs/platform/theme/common/themeService';
23
25
  import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService.service';
24
26
  import { Sorter, AccessibilityProvider, IdentityProvider, VirtualDelegate, TypeRenderer, DataSource } from './typeHierarchyTree.js';
27
+ import { TypeHierarchyDirection } from 'vscode/vscode/vs/workbench/contrib/typeHierarchy/common/typeHierarchy';
25
28
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
29
+ import { Orientation } from 'vscode/vscode/vs/base/browser/ui/sash/sash';
26
30
 
27
31
  var TypeHierarchyTreePeekWidget_1;
28
32
  const _moduleId = "vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek";
33
+ var State;
34
+ ( ((function(State) {
35
+ State["Loading"] = "loading";
36
+ State["Message"] = "message";
37
+ State["Data"] = "data";
38
+ })(State || (State = {}))));
29
39
  class LayoutInfo {
30
40
  static store(info, storageService) {
31
- storageService.store('typeHierarchyPeekLayout', JSON.stringify(info), 0 , 1 );
41
+ storageService.store('typeHierarchyPeekLayout', JSON.stringify(info), StorageScope.PROFILE, StorageTarget.MACHINE);
32
42
  }
33
43
  static retrieve(storageService) {
34
- const value = storageService.get('typeHierarchyPeekLayout', 0 , '{}');
44
+ const value = storageService.get('typeHierarchyPeekLayout', StorageScope.PROFILE, '{}');
35
45
  const defaultInfo = { ratio: 0.7, height: 17 };
36
46
  try {
37
47
  return { ...defaultInfo, ...JSON.parse(value) };
@@ -115,7 +125,7 @@ let TypeHierarchyTreePeekWidget = class TypeHierarchyTreePeekWidget extends Peek
115
125
  const container = document.createElement('div');
116
126
  container.classList.add('results');
117
127
  parent.appendChild(container);
118
- this._splitView = ( (new SplitView(container, { orientation: 1 })));
128
+ this._splitView = ( (new SplitView(container, { orientation: Orientation.HORIZONTAL })));
119
129
  const editorContainer = document.createElement('div');
120
130
  editorContainer.classList.add('editor');
121
131
  container.appendChild(editorContainer);
@@ -223,7 +233,7 @@ let TypeHierarchyTreePeekWidget = class TypeHierarchyTreePeekWidget extends Peek
223
233
  this._previewDisposable.clear();
224
234
  const options = {
225
235
  description: 'type-hierarchy-decoration',
226
- stickiness: 1 ,
236
+ stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
227
237
  className: 'type-decoration',
228
238
  overviewRuler: {
229
239
  color: themeColorFromId(peekViewEditorMatchHighlight),
@@ -231,7 +241,7 @@ let TypeHierarchyTreePeekWidget = class TypeHierarchyTreePeekWidget extends Peek
231
241
  },
232
242
  };
233
243
  let previewUri;
234
- if (this._direction === "supertypes" ) {
244
+ if (this._direction === TypeHierarchyDirection.Supertypes) {
235
245
  previewUri = element.parent ? element.parent.item.uri : element.model.root.uri;
236
246
  }
237
247
  else {
@@ -247,23 +257,23 @@ let TypeHierarchyTreePeekWidget = class TypeHierarchyTreePeekWidget extends Peek
247
257
  fullRange = !fullRange ? loc.range : Range.plusRange(loc.range, fullRange);
248
258
  }
249
259
  if (fullRange) {
250
- this._editor.revealRangeInCenter(fullRange, 1 );
260
+ this._editor.revealRangeInCenter(fullRange, ScrollType.Immediate);
251
261
  const decorationsCollection = this._editor.createDecorationsCollection(decorations);
252
262
  this._previewDisposable.add(toDisposable(() => decorationsCollection.clear()));
253
263
  }
254
264
  this._previewDisposable.add(value);
255
- const title = this._direction === "supertypes"
265
+ const title = this._direction === TypeHierarchyDirection.Supertypes
256
266
  ? ( localizeWithPath(_moduleId, 0, "Supertypes of '{0}'", element.model.root.name))
257
267
  : ( localizeWithPath(_moduleId, 1, "Subtypes of '{0}'", element.model.root.name));
258
268
  this.setTitle(title);
259
269
  }
260
270
  showLoading() {
261
- this._parent.dataset['state'] = "loading" ;
271
+ this._parent.dataset['state'] = State.Loading;
262
272
  this.setTitle(( localizeWithPath(_moduleId, 2, "Loading...")));
263
273
  this._show();
264
274
  }
265
275
  showMessage(message) {
266
- this._parent.dataset['state'] = "message" ;
276
+ this._parent.dataset['state'] = State.Message;
267
277
  this.setTitle('');
268
278
  this.setMetaTitle('');
269
279
  this._message.innerText = message;
@@ -277,12 +287,12 @@ let TypeHierarchyTreePeekWidget = class TypeHierarchyTreePeekWidget extends Peek
277
287
  const root = this._tree.getNode(model).children[0];
278
288
  await this._tree.expand(root.element);
279
289
  if (root.children.length === 0) {
280
- this.showMessage(this._direction === "supertypes"
290
+ this.showMessage(this._direction === TypeHierarchyDirection.Supertypes
281
291
  ? ( localizeWithPath(_moduleId, 3, "No supertypes of '{0}'", model.root.name))
282
292
  : ( localizeWithPath(_moduleId, 4, "No subtypes of '{0}'", model.root.name)));
283
293
  }
284
294
  else {
285
- this._parent.dataset['state'] = "data" ;
295
+ this._parent.dataset['state'] = State.Data;
286
296
  if (!viewState || this._tree.getFocus().length === 0) {
287
297
  this._tree.setFocus([root.children[0].element]);
288
298
  }
@@ -306,7 +316,7 @@ let TypeHierarchyTreePeekWidget = class TypeHierarchyTreePeekWidget extends Peek
306
316
  }
307
317
  _show() {
308
318
  if (!this._isShowing) {
309
- this.editor.revealLineInCenterIfOutsideViewport(this._where.lineNumber, 0 );
319
+ this.editor.revealLineInCenterIfOutsideViewport(this._where.lineNumber, ScrollType.Smooth);
310
320
  super.show(Range.fromPositions(this._where), this._layoutInfo.height);
311
321
  }
312
322
  }
@@ -1,8 +1,8 @@
1
- import { TypeHierarchyModel } from 'vscode/vscode/vs/workbench/contrib/typeHierarchy/common/typeHierarchy';
1
+ import { TypeHierarchyModel, TypeHierarchyDirection } from 'vscode/vscode/vs/workbench/contrib/typeHierarchy/common/typeHierarchy';
2
2
  import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
3
3
  import { createMatches } from 'vscode/vscode/vs/base/common/filters';
4
4
  import { IconLabel } from 'vscode/vscode/vs/base/browser/ui/iconLabel/iconLabel';
5
- import { SymbolKinds } from 'vscode/vscode/vs/editor/common/languages';
5
+ import { SymbolTag, SymbolKinds } from 'vscode/vscode/vs/editor/common/languages';
6
6
  import { compare } from 'vscode/vscode/vs/base/common/strings';
7
7
  import { Range } from 'vscode/vscode/vs/editor/common/core/range';
8
8
  import { localizeWithPath } from 'vscode/vscode/vs/nls';
@@ -37,7 +37,7 @@ class DataSource {
37
37
  );
38
38
  }
39
39
  const { model, item } = element;
40
- if (this.getDirection() === "supertypes" ) {
40
+ if (this.getDirection() === TypeHierarchyDirection.Supertypes) {
41
41
  return (
42
42
  ((await model.provideSupertypes(item, CancellationToken.None)).map(item => {
43
43
  return (
@@ -96,7 +96,7 @@ class TypeRenderer {
96
96
  }
97
97
  renderElement(node, _index, template) {
98
98
  const { element, filterData } = node;
99
- const deprecated = element.item.tags?.includes(1 );
99
+ const deprecated = element.item.tags?.includes(SymbolTag.Deprecated);
100
100
  template.icon.classList.add('inline', ...ThemeIcon.asClassNameArray(SymbolKinds.toIcon(element.item.kind)));
101
101
  template.label.setLabel(element.item.name, element.item.detail, { labelEscapeNewLines: true, matches: createMatches(filterData), strikethrough: deprecated });
102
102
  }
@@ -120,7 +120,7 @@ class AccessibilityProvider {
120
120
  return ( localizeWithPath(_moduleId, 0, "Type Hierarchy"));
121
121
  }
122
122
  getAriaLabel(element) {
123
- if (this.getDirection() === "supertypes" ) {
123
+ if (this.getDirection() === TypeHierarchyDirection.Supertypes) {
124
124
  return ( localizeWithPath(_moduleId, 1, "supertypes of {0}", element.item.name));
125
125
  }
126
126
  else {
@@ -2,7 +2,7 @@ import { isUNC } from 'vscode/vscode/vs/base/common/extpath';
2
2
  import { Schemas } from 'vscode/vscode/vs/base/common/network';
3
3
  import { normalize, sep } from 'vscode/vscode/vs/base/common/path';
4
4
  import { URI } from 'vscode/vscode/vs/base/common/uri';
5
- import { FileOperationError } from 'vscode/vscode/vs/platform/files/common/files';
5
+ import { FileOperationError, FileOperationResult } from 'vscode/vscode/vs/platform/files/common/files';
6
6
  import { getWebviewContentMimeType } from '../../../../platform/webview/common/mimeTypes.js';
7
7
 
8
8
  var WebviewResourceResponse;
@@ -50,7 +50,7 @@ async function loadLocalResource(requestUri, options, fileService, logService, t
50
50
  catch (err) {
51
51
  if (err instanceof FileOperationError) {
52
52
  const result = err.fileOperationResult;
53
- if (result === 2 ) {
53
+ if (result === FileOperationResult.FILE_NOT_MODIFIED_SINCE) {
54
54
  return new WebviewResourceResponse.NotModified(mime, err.options?.mtime);
55
55
  }
56
56
  }
@@ -32,18 +32,19 @@ import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/service
32
32
  const _moduleId = "vs/workbench/contrib/webview/browser/webviewElement";
33
33
  var WebviewState;
34
34
  ( ((function(WebviewState) {
35
+ let Type;
35
36
  ( ((function(Type) {
36
37
  Type[Type["Initializing"] = 0] = "Initializing";
37
38
  Type[Type["Ready"] = 1] = "Ready";
38
- })(WebviewState.Type || (WebviewState.Type = {}))));
39
+ })(Type = WebviewState.Type || (WebviewState.Type = {}))));
39
40
  class Initializing {
40
41
  constructor(pendingMessages) {
41
42
  this.pendingMessages = pendingMessages;
42
- this.type = 0 ;
43
+ this.type = Type.Initializing;
43
44
  }
44
45
  }
45
46
  WebviewState.Initializing = Initializing;
46
- WebviewState.Ready = { type: 1 };
47
+ WebviewState.Ready = { type: Type.Ready };
47
48
  })(WebviewState || (WebviewState = {}))));
48
49
  const webviewIdContext = 'webviewId';
49
50
  let WebviewElement = class WebviewElement extends Disposable {
@@ -236,7 +237,7 @@ let WebviewElement = class WebviewElement extends Disposable {
236
237
  this.element?.remove();
237
238
  this._element = undefined;
238
239
  this._messagePort = undefined;
239
- if (this._state.type === 0 ) {
240
+ if (this._state.type === WebviewState.Type.Initializing) {
240
241
  for (const message of this._state.pendingMessages) {
241
242
  message.resolve(false);
242
243
  }
@@ -253,7 +254,7 @@ let WebviewElement = class WebviewElement extends Disposable {
253
254
  return this._send('message', { message, transfer });
254
255
  }
255
256
  async _send(channel, data, _createElement = []) {
256
- if (this._state.type === 0 ) {
257
+ if (this._state.type === WebviewState.Type.Initializing) {
257
258
  const { promise, resolve } = promiseWithResolvers();
258
259
  this._state.pendingMessages.push({ channel, data, transferable: _createElement, resolve });
259
260
  return promise;
@@ -355,7 +356,7 @@ let WebviewElement = class WebviewElement extends Disposable {
355
356
  handlers?.forEach(handler => handler(e.data.data, e));
356
357
  };
357
358
  this.element?.classList.add('ready');
358
- if (this._state.type === 0 ) {
359
+ if (this._state.type === WebviewState.Type.Initializing) {
359
360
  this._state.pendingMessages.forEach(({ channel, data, resolve }) => resolve(this.doPostMessage(channel, data)));
360
361
  }
361
362
  this._state = WebviewState.Ready;
@@ -1,6 +1,6 @@
1
1
  import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
2
  import { Emitter } from 'vscode/vscode/vs/base/common/event';
3
- import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
3
+ import { Disposable, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
4
4
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
5
5
  import { WebviewThemeDataProvider } from './themeing.js';
6
6
  import { WebviewElement } from './webviewElement.js';
@@ -37,19 +37,21 @@ let WebviewService = class WebviewService extends Disposable {
37
37
  }
38
38
  registerNewWebview(webview) {
39
39
  this._webviews.add(webview);
40
- webview.onDidFocus(() => {
40
+ const store = ( new DisposableStore());
41
+ store.add(webview.onDidFocus(() => {
41
42
  this._updateActiveWebview(webview);
42
- });
43
+ }));
43
44
  const onBlur = () => {
44
45
  if (this._activeWebview === webview) {
45
46
  this._updateActiveWebview(undefined);
46
47
  }
47
48
  };
48
- webview.onDidBlur(onBlur);
49
- webview.onDidDispose(() => {
49
+ store.add(webview.onDidBlur(onBlur));
50
+ store.add(webview.onDidDispose(() => {
50
51
  onBlur();
52
+ store.dispose();
51
53
  this._webviews.delete(webview);
52
- });
54
+ }));
53
55
  }
54
56
  };
55
57
  WebviewService = ( __decorate([