@codingame/monaco-vscode-views-service-override 1.85.2 → 1.85.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/package.json +11 -11
- package/views.js +0 -5
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsOutline.js +0 -371
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsTree.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsTree.js +0 -277
- package/vscode/src/vs/workbench/contrib/outline/browser/outline.contribution.js +0 -367
- package/vscode/src/vs/workbench/contrib/outline/browser/outline.js +0 -12
- package/vscode/src/vs/workbench/contrib/outline/browser/outlinePane.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/outline/browser/outlinePane.js +0 -307
- package/vscode/src/vs/workbench/contrib/outline/browser/outlineViewState.js +0 -68
- package/vscode/src/vs/workbench/services/outline/browser/outlineService.js +0 -37
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-views-service-override",
|
|
3
|
-
"version": "1.85.
|
|
3
|
+
"version": "1.85.3",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,16 +18,16 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@1.85.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@1.85.3",
|
|
22
22
|
"monaco-editor": "0.45.0",
|
|
23
|
-
"@codingame/monaco-vscode-bulk-edit-service-override": "1.85.
|
|
24
|
-
"@codingame/monaco-vscode-layout-service-override": "1.85.
|
|
25
|
-
"@codingame/monaco-vscode-quickaccess-service-override": "1.85.
|
|
26
|
-
"@codingame/monaco-vscode-keybindings-service-override": "1.85.
|
|
27
|
-
"@codingame/monaco-vscode-files-service-override": "1.85.
|
|
28
|
-
"@codingame/monaco-vscode-extensions-service-override": "1.85.
|
|
29
|
-
"@codingame/monaco-vscode-environment-service-override": "1.85.
|
|
30
|
-
"@codingame/monaco-vscode-host-service-override": "1.85.
|
|
31
|
-
"@codingame/monaco-vscode-base-service-override": "1.85.
|
|
23
|
+
"@codingame/monaco-vscode-bulk-edit-service-override": "1.85.3",
|
|
24
|
+
"@codingame/monaco-vscode-layout-service-override": "1.85.3",
|
|
25
|
+
"@codingame/monaco-vscode-quickaccess-service-override": "1.85.3",
|
|
26
|
+
"@codingame/monaco-vscode-keybindings-service-override": "1.85.3",
|
|
27
|
+
"@codingame/monaco-vscode-files-service-override": "1.85.3",
|
|
28
|
+
"@codingame/monaco-vscode-extensions-service-override": "1.85.3",
|
|
29
|
+
"@codingame/monaco-vscode-environment-service-override": "1.85.3",
|
|
30
|
+
"@codingame/monaco-vscode-host-service-override": "1.85.3",
|
|
31
|
+
"@codingame/monaco-vscode-base-service-override": "1.85.3"
|
|
32
32
|
}
|
|
33
33
|
}
|
package/views.js
CHANGED
|
@@ -26,8 +26,6 @@ import './vscode/src/vs/workbench/contrib/files/browser/fileCommands.js';
|
|
|
26
26
|
import './vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js';
|
|
27
27
|
import './vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js';
|
|
28
28
|
import './vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js';
|
|
29
|
-
import './vscode/src/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsOutline.js';
|
|
30
|
-
import './vscode/src/vs/workbench/contrib/outline/browser/outline.contribution.js';
|
|
31
29
|
import './vscode/src/vs/workbench/browser/actions/listCommands.js';
|
|
32
30
|
import 'vscode/vscode/vs/workbench/browser/parts/views/media/views.css';
|
|
33
31
|
import './vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js';
|
|
@@ -65,8 +63,6 @@ import { registerAction2, Action2, MenuId } from 'monaco-editor/esm/vs/platform/
|
|
|
65
63
|
import { Categories } from 'monaco-editor/esm/vs/platform/action/common/actionCommonCategories.js';
|
|
66
64
|
import { ContextKeyExpr } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
67
65
|
import { BaseActionViewItem } from 'monaco-editor/esm/vs/base/browser/ui/actionbar/actionViewItems.js';
|
|
68
|
-
import { IOutlineService } from 'vscode/vscode/vs/workbench/services/outline/browser/outline';
|
|
69
|
-
import { OutlineService } from './vscode/src/vs/workbench/services/outline/browser/outlineService.js';
|
|
70
66
|
import { ICustomEditorService } from 'vscode/vscode/vs/workbench/contrib/customEditor/common/customEditor';
|
|
71
67
|
import { CustomEditorService } from './vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js';
|
|
72
68
|
import { WebviewService } from './vscode/src/vs/workbench/contrib/webview/browser/webviewService.js';
|
|
@@ -790,7 +786,6 @@ function getServiceOverride(openEditorFallback, _webviewIframeAlternateDomains,
|
|
|
790
786
|
[( IContextViewService.toString())]: new SyncDescriptor(ContextViewService, [], true),
|
|
791
787
|
[( IUntitledTextEditorService.toString())]: new SyncDescriptor(UntitledTextEditorService, [], true),
|
|
792
788
|
[( IHistoryService.toString())]: new SyncDescriptor(HistoryService, [], false),
|
|
793
|
-
[( IOutlineService.toString())]: new SyncDescriptor(OutlineService, [], true),
|
|
794
789
|
[( ICustomEditorService.toString())]: new SyncDescriptor(CustomEditorService, [], true),
|
|
795
790
|
[( IWebviewService.toString())]: new SyncDescriptor(WebviewService, [], true),
|
|
796
791
|
[( IWebviewViewService.toString())]: new SyncDescriptor(WebviewViewService, [], true),
|
package/vscode/src/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsOutline.js
DELETED
|
@@ -1,371 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
3
|
-
import { DisposableStore, Disposable, toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
4
|
-
import { IOutlineService } from 'vscode/vscode/vs/workbench/services/outline/browser/outline';
|
|
5
|
-
import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
6
|
-
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
7
|
-
import { DocumentSymbolFilter, DocumentSymbolGroupRenderer, DocumentSymbolRenderer, DocumentSymbolComparator, DocumentSymbolIdentityProvider, DocumentSymbolNavigationLabelProvider, DocumentSymbolAccessibilityProvider, DocumentSymbolVirtualDelegate } from './documentSymbolsTree.js';
|
|
8
|
-
import { isCodeEditor, isDiffEditor } from 'monaco-editor/esm/vs/editor/browser/editorBrowser.js';
|
|
9
|
-
import { OutlineModel, OutlineGroup, OutlineElement, TreeElement, IOutlineModelService } from 'monaco-editor/esm/vs/editor/contrib/documentSymbols/browser/outlineModel.js';
|
|
10
|
-
import { CancellationTokenSource } from 'monaco-editor/esm/vs/base/common/cancellation.js';
|
|
11
|
-
import { Barrier, TimeoutTimer, timeout, raceCancellation } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
12
|
-
import { onUnexpectedError } from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
13
|
-
import { ITextResourceConfigurationService } from 'monaco-editor/esm/vs/editor/common/services/textResourceConfiguration.js';
|
|
14
|
-
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
15
|
-
import { Range } from 'monaco-editor/esm/vs/editor/common/core/range.js';
|
|
16
|
-
import { ICodeEditorService } from 'monaco-editor/esm/vs/editor/browser/services/codeEditorService.js';
|
|
17
|
-
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
18
|
-
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
19
|
-
import { IMarkerDecorationsService } from 'monaco-editor/esm/vs/editor/common/services/markerDecorations.js';
|
|
20
|
-
import { MarkerSeverity } from 'monaco-editor/esm/vs/platform/markers/common/markers.js';
|
|
21
|
-
import { isEqual } from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
22
|
-
import { ILanguageFeaturesService } from 'monaco-editor/esm/vs/editor/common/services/languageFeatures.js';
|
|
23
|
-
|
|
24
|
-
let DocumentSymbolBreadcrumbsSource = class DocumentSymbolBreadcrumbsSource {
|
|
25
|
-
constructor(_editor, _textResourceConfigurationService) {
|
|
26
|
-
this._editor = _editor;
|
|
27
|
-
this._textResourceConfigurationService = _textResourceConfigurationService;
|
|
28
|
-
this._breadcrumbs = [];
|
|
29
|
-
}
|
|
30
|
-
getBreadcrumbElements() {
|
|
31
|
-
return this._breadcrumbs;
|
|
32
|
-
}
|
|
33
|
-
clear() {
|
|
34
|
-
this._breadcrumbs = [];
|
|
35
|
-
}
|
|
36
|
-
update(model, position) {
|
|
37
|
-
const newElements = this._computeBreadcrumbs(model, position);
|
|
38
|
-
this._breadcrumbs = newElements;
|
|
39
|
-
}
|
|
40
|
-
_computeBreadcrumbs(model, position) {
|
|
41
|
-
let item = model.getItemEnclosingPosition(position);
|
|
42
|
-
if (!item) {
|
|
43
|
-
return [];
|
|
44
|
-
}
|
|
45
|
-
const chain = [];
|
|
46
|
-
while (item) {
|
|
47
|
-
chain.push(item);
|
|
48
|
-
const parent = item.parent;
|
|
49
|
-
if (parent instanceof OutlineModel) {
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
if (parent instanceof OutlineGroup && parent.parent && parent.parent.children.size === 1) {
|
|
53
|
-
break;
|
|
54
|
-
}
|
|
55
|
-
item = parent;
|
|
56
|
-
}
|
|
57
|
-
const result = [];
|
|
58
|
-
for (let i = chain.length - 1; i >= 0; i--) {
|
|
59
|
-
const element = chain[i];
|
|
60
|
-
if (this._isFiltered(element)) {
|
|
61
|
-
break;
|
|
62
|
-
}
|
|
63
|
-
result.push(element);
|
|
64
|
-
}
|
|
65
|
-
if (result.length === 0) {
|
|
66
|
-
return [];
|
|
67
|
-
}
|
|
68
|
-
return result;
|
|
69
|
-
}
|
|
70
|
-
_isFiltered(element) {
|
|
71
|
-
if (!(element instanceof OutlineElement)) {
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
const key = `breadcrumbs.${DocumentSymbolFilter.kindToConfigName[element.symbol.kind]}`;
|
|
75
|
-
let uri;
|
|
76
|
-
if (this._editor && this._editor.getModel()) {
|
|
77
|
-
const model = this._editor.getModel();
|
|
78
|
-
uri = model.uri;
|
|
79
|
-
}
|
|
80
|
-
return !this._textResourceConfigurationService.getValue(uri, key);
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
DocumentSymbolBreadcrumbsSource = ( __decorate([
|
|
84
|
-
( __param(1, ITextResourceConfigurationService))
|
|
85
|
-
], DocumentSymbolBreadcrumbsSource));
|
|
86
|
-
let DocumentSymbolsOutline = class DocumentSymbolsOutline {
|
|
87
|
-
get activeElement() {
|
|
88
|
-
const posistion = this._editor.getPosition();
|
|
89
|
-
if (!posistion || !this._outlineModel) {
|
|
90
|
-
return undefined;
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
return this._outlineModel.getItemEnclosingPosition(posistion);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
constructor(_editor, target, firstLoadBarrier, _languageFeaturesService, _codeEditorService, _outlineModelService, _configurationService, _markerDecorationsService, textResourceConfigurationService, instantiationService) {
|
|
97
|
-
this._editor = _editor;
|
|
98
|
-
this._languageFeaturesService = _languageFeaturesService;
|
|
99
|
-
this._codeEditorService = _codeEditorService;
|
|
100
|
-
this._outlineModelService = _outlineModelService;
|
|
101
|
-
this._configurationService = _configurationService;
|
|
102
|
-
this._markerDecorationsService = _markerDecorationsService;
|
|
103
|
-
this._disposables = ( new DisposableStore());
|
|
104
|
-
this._onDidChange = ( new Emitter());
|
|
105
|
-
this.onDidChange = this._onDidChange.event;
|
|
106
|
-
this._outlineDisposables = ( new DisposableStore());
|
|
107
|
-
this.outlineKind = 'documentSymbols';
|
|
108
|
-
this._breadcrumbsDataSource = ( new DocumentSymbolBreadcrumbsSource(_editor, textResourceConfigurationService));
|
|
109
|
-
const delegate = ( new DocumentSymbolVirtualDelegate());
|
|
110
|
-
const renderers = [( new DocumentSymbolGroupRenderer()), instantiationService.createInstance(DocumentSymbolRenderer, true)];
|
|
111
|
-
const treeDataSource = {
|
|
112
|
-
getChildren: (parent) => {
|
|
113
|
-
if (parent instanceof OutlineElement || parent instanceof OutlineGroup) {
|
|
114
|
-
return ( parent.children.values());
|
|
115
|
-
}
|
|
116
|
-
if (parent === this && this._outlineModel) {
|
|
117
|
-
return ( this._outlineModel.children.values());
|
|
118
|
-
}
|
|
119
|
-
return [];
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
const comparator = ( new DocumentSymbolComparator());
|
|
123
|
-
const initialState = textResourceConfigurationService.getValue(_editor.getModel()?.uri, "outline.collapseItems" );
|
|
124
|
-
const options = {
|
|
125
|
-
collapseByDefault: target === 2 || ((target === 1 && initialState === "alwaysCollapse") ),
|
|
126
|
-
expandOnlyOnTwistieClick: true,
|
|
127
|
-
multipleSelectionSupport: false,
|
|
128
|
-
identityProvider: ( new DocumentSymbolIdentityProvider()),
|
|
129
|
-
keyboardNavigationLabelProvider: ( new DocumentSymbolNavigationLabelProvider()),
|
|
130
|
-
accessibilityProvider: ( new DocumentSymbolAccessibilityProvider(( localizeWithPath(
|
|
131
|
-
'vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsOutline',
|
|
132
|
-
'document',
|
|
133
|
-
"Document Symbols"
|
|
134
|
-
)))),
|
|
135
|
-
filter: target === 1
|
|
136
|
-
? instantiationService.createInstance(DocumentSymbolFilter, 'outline')
|
|
137
|
-
: target === 2
|
|
138
|
-
? instantiationService.createInstance(DocumentSymbolFilter, 'breadcrumbs')
|
|
139
|
-
: undefined
|
|
140
|
-
};
|
|
141
|
-
this.config = {
|
|
142
|
-
breadcrumbsDataSource: this._breadcrumbsDataSource,
|
|
143
|
-
delegate,
|
|
144
|
-
renderers,
|
|
145
|
-
treeDataSource,
|
|
146
|
-
comparator,
|
|
147
|
-
options,
|
|
148
|
-
quickPickDataSource: { getQuickPickElements: () => { throw new Error('not implemented'); } }
|
|
149
|
-
};
|
|
150
|
-
this._disposables.add(_languageFeaturesService.documentSymbolProvider.onDidChange(_ => this._createOutline()));
|
|
151
|
-
this._disposables.add(this._editor.onDidChangeModel(_ => this._createOutline()));
|
|
152
|
-
this._disposables.add(this._editor.onDidChangeModelLanguage(_ => this._createOutline()));
|
|
153
|
-
const updateSoon = ( new TimeoutTimer());
|
|
154
|
-
this._disposables.add(updateSoon);
|
|
155
|
-
this._disposables.add(this._editor.onDidChangeModelContent(event => {
|
|
156
|
-
const model = this._editor.getModel();
|
|
157
|
-
if (model) {
|
|
158
|
-
const timeout = _outlineModelService.getDebounceValue(model);
|
|
159
|
-
updateSoon.cancelAndSet(() => this._createOutline(event), timeout);
|
|
160
|
-
}
|
|
161
|
-
}));
|
|
162
|
-
this._disposables.add(this._editor.onDidDispose(() => this._outlineDisposables.clear()));
|
|
163
|
-
this._createOutline().finally(() => firstLoadBarrier.open());
|
|
164
|
-
}
|
|
165
|
-
dispose() {
|
|
166
|
-
this._disposables.dispose();
|
|
167
|
-
this._outlineDisposables.dispose();
|
|
168
|
-
}
|
|
169
|
-
get isEmpty() {
|
|
170
|
-
return !this._outlineModel || TreeElement.empty(this._outlineModel);
|
|
171
|
-
}
|
|
172
|
-
get uri() {
|
|
173
|
-
return this._outlineModel?.uri;
|
|
174
|
-
}
|
|
175
|
-
async reveal(entry, options, sideBySide) {
|
|
176
|
-
const model = OutlineModel.get(entry);
|
|
177
|
-
if (!model || !(entry instanceof OutlineElement)) {
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
await this._codeEditorService.openCodeEditor({
|
|
181
|
-
resource: model.uri,
|
|
182
|
-
options: {
|
|
183
|
-
...options,
|
|
184
|
-
selection: Range.collapseToStart(entry.symbol.selectionRange),
|
|
185
|
-
selectionRevealType: 3 ,
|
|
186
|
-
}
|
|
187
|
-
}, this._editor, sideBySide);
|
|
188
|
-
}
|
|
189
|
-
preview(entry) {
|
|
190
|
-
if (!(entry instanceof OutlineElement)) {
|
|
191
|
-
return Disposable.None;
|
|
192
|
-
}
|
|
193
|
-
const { symbol } = entry;
|
|
194
|
-
this._editor.revealRangeInCenterIfOutsideViewport(symbol.range, 0 );
|
|
195
|
-
const decorationsCollection = this._editor.createDecorationsCollection([{
|
|
196
|
-
range: symbol.range,
|
|
197
|
-
options: {
|
|
198
|
-
description: 'document-symbols-outline-range-highlight',
|
|
199
|
-
className: 'rangeHighlight',
|
|
200
|
-
isWholeLine: true
|
|
201
|
-
}
|
|
202
|
-
}]);
|
|
203
|
-
return toDisposable(() => decorationsCollection.clear());
|
|
204
|
-
}
|
|
205
|
-
captureViewState() {
|
|
206
|
-
const viewState = this._editor.saveViewState();
|
|
207
|
-
return toDisposable(() => {
|
|
208
|
-
if (viewState) {
|
|
209
|
-
this._editor.restoreViewState(viewState);
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
async _createOutline(contentChangeEvent) {
|
|
214
|
-
this._outlineDisposables.clear();
|
|
215
|
-
if (!contentChangeEvent) {
|
|
216
|
-
this._setOutlineModel(undefined);
|
|
217
|
-
}
|
|
218
|
-
if (!this._editor.hasModel()) {
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
const buffer = this._editor.getModel();
|
|
222
|
-
if (!( this._languageFeaturesService.documentSymbolProvider.has(buffer))) {
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
const cts = ( new CancellationTokenSource());
|
|
226
|
-
const versionIdThen = buffer.getVersionId();
|
|
227
|
-
const timeoutTimer = ( new TimeoutTimer());
|
|
228
|
-
this._outlineDisposables.add(timeoutTimer);
|
|
229
|
-
this._outlineDisposables.add(toDisposable(() => cts.dispose(true)));
|
|
230
|
-
try {
|
|
231
|
-
const model = await this._outlineModelService.getOrCreate(buffer, cts.token);
|
|
232
|
-
if (cts.token.isCancellationRequested) {
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
|
-
if (TreeElement.empty(model) || !this._editor.hasModel()) {
|
|
236
|
-
this._setOutlineModel(model);
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
if (contentChangeEvent && this._outlineModel && buffer.getLineCount() >= 25) {
|
|
240
|
-
const newSize = TreeElement.size(model);
|
|
241
|
-
const newLength = buffer.getValueLength();
|
|
242
|
-
const newRatio = newSize / newLength;
|
|
243
|
-
const oldSize = TreeElement.size(this._outlineModel);
|
|
244
|
-
const oldLength = newLength - contentChangeEvent.changes.reduce((prev, value) => prev + value.rangeLength, 0);
|
|
245
|
-
const oldRatio = oldSize / oldLength;
|
|
246
|
-
if (newRatio <= oldRatio * 0.5 || newRatio >= oldRatio * 1.5) {
|
|
247
|
-
const value = await raceCancellation(timeout(2000).then(() => true), cts.token, false);
|
|
248
|
-
if (!value) {
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
this._applyMarkersToOutline(model);
|
|
254
|
-
this._outlineDisposables.add(this._markerDecorationsService.onDidChangeMarker(textModel => {
|
|
255
|
-
if (isEqual(model.uri, textModel.uri)) {
|
|
256
|
-
this._applyMarkersToOutline(model);
|
|
257
|
-
this._onDidChange.fire({});
|
|
258
|
-
}
|
|
259
|
-
}));
|
|
260
|
-
this._outlineDisposables.add(this._configurationService.onDidChangeConfiguration(e => {
|
|
261
|
-
if (e.affectsConfiguration("outline.problems.enabled" ) || e.affectsConfiguration('problems.visibility')) {
|
|
262
|
-
const problem = this._configurationService.getValue('problems.visibility');
|
|
263
|
-
const config = this._configurationService.getValue("outline.problems.enabled" );
|
|
264
|
-
if (!problem || !config) {
|
|
265
|
-
model.updateMarker([]);
|
|
266
|
-
}
|
|
267
|
-
else {
|
|
268
|
-
this._applyMarkersToOutline(model);
|
|
269
|
-
}
|
|
270
|
-
this._onDidChange.fire({});
|
|
271
|
-
}
|
|
272
|
-
if (e.affectsConfiguration('outline')) {
|
|
273
|
-
this._onDidChange.fire({});
|
|
274
|
-
}
|
|
275
|
-
if (e.affectsConfiguration('breadcrumbs') && this._editor.hasModel()) {
|
|
276
|
-
this._breadcrumbsDataSource.update(model, this._editor.getPosition());
|
|
277
|
-
this._onDidChange.fire({});
|
|
278
|
-
}
|
|
279
|
-
}));
|
|
280
|
-
this._outlineDisposables.add(this._configurationService.onDidChangeConfiguration(e => {
|
|
281
|
-
if (e.affectsConfiguration("outline.icons" )) {
|
|
282
|
-
this._onDidChange.fire({});
|
|
283
|
-
}
|
|
284
|
-
if (e.affectsConfiguration('outline')) {
|
|
285
|
-
this._onDidChange.fire({});
|
|
286
|
-
}
|
|
287
|
-
}));
|
|
288
|
-
this._outlineDisposables.add(this._editor.onDidChangeCursorPosition(_ => {
|
|
289
|
-
timeoutTimer.cancelAndSet(() => {
|
|
290
|
-
if (!buffer.isDisposed() && versionIdThen === buffer.getVersionId() && this._editor.hasModel()) {
|
|
291
|
-
this._breadcrumbsDataSource.update(model, this._editor.getPosition());
|
|
292
|
-
this._onDidChange.fire({ affectOnlyActiveElement: true });
|
|
293
|
-
}
|
|
294
|
-
}, 150);
|
|
295
|
-
}));
|
|
296
|
-
this._setOutlineModel(model);
|
|
297
|
-
}
|
|
298
|
-
catch (err) {
|
|
299
|
-
this._setOutlineModel(undefined);
|
|
300
|
-
onUnexpectedError(err);
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
_applyMarkersToOutline(model) {
|
|
304
|
-
const problem = this._configurationService.getValue('problems.visibility');
|
|
305
|
-
const config = this._configurationService.getValue("outline.problems.enabled" );
|
|
306
|
-
if (!model || !problem || !config) {
|
|
307
|
-
return;
|
|
308
|
-
}
|
|
309
|
-
const markers = [];
|
|
310
|
-
for (const [range, marker] of this._markerDecorationsService.getLiveMarkers(model.uri)) {
|
|
311
|
-
if (marker.severity === MarkerSeverity.Error || marker.severity === MarkerSeverity.Warning) {
|
|
312
|
-
markers.push({ ...range, severity: marker.severity });
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
model.updateMarker(markers);
|
|
316
|
-
}
|
|
317
|
-
_setOutlineModel(model) {
|
|
318
|
-
const position = this._editor.getPosition();
|
|
319
|
-
if (!position || !model) {
|
|
320
|
-
this._outlineModel = undefined;
|
|
321
|
-
this._breadcrumbsDataSource.clear();
|
|
322
|
-
}
|
|
323
|
-
else {
|
|
324
|
-
if (!this._outlineModel?.merge(model)) {
|
|
325
|
-
this._outlineModel = model;
|
|
326
|
-
}
|
|
327
|
-
this._breadcrumbsDataSource.update(model, position);
|
|
328
|
-
}
|
|
329
|
-
this._onDidChange.fire({});
|
|
330
|
-
}
|
|
331
|
-
};
|
|
332
|
-
DocumentSymbolsOutline = ( __decorate([
|
|
333
|
-
( __param(3, ILanguageFeaturesService)),
|
|
334
|
-
( __param(4, ICodeEditorService)),
|
|
335
|
-
( __param(5, IOutlineModelService)),
|
|
336
|
-
( __param(6, IConfigurationService)),
|
|
337
|
-
( __param(7, IMarkerDecorationsService)),
|
|
338
|
-
( __param(8, ITextResourceConfigurationService)),
|
|
339
|
-
( __param(9, IInstantiationService))
|
|
340
|
-
], DocumentSymbolsOutline));
|
|
341
|
-
let DocumentSymbolsOutlineCreator = class DocumentSymbolsOutlineCreator {
|
|
342
|
-
constructor(outlineService) {
|
|
343
|
-
const reg = outlineService.registerOutlineCreator(this);
|
|
344
|
-
this.dispose = () => reg.dispose();
|
|
345
|
-
}
|
|
346
|
-
matches(candidate) {
|
|
347
|
-
const ctrl = candidate.getControl();
|
|
348
|
-
return isCodeEditor(ctrl) || isDiffEditor(ctrl);
|
|
349
|
-
}
|
|
350
|
-
async createOutline(pane, target, _token) {
|
|
351
|
-
const control = pane.getControl();
|
|
352
|
-
let editor;
|
|
353
|
-
if (isCodeEditor(control)) {
|
|
354
|
-
editor = control;
|
|
355
|
-
}
|
|
356
|
-
else if (isDiffEditor(control)) {
|
|
357
|
-
editor = control.getModifiedEditor();
|
|
358
|
-
}
|
|
359
|
-
if (!editor) {
|
|
360
|
-
return undefined;
|
|
361
|
-
}
|
|
362
|
-
const firstLoadBarrier = ( new Barrier());
|
|
363
|
-
const result = editor.invokeWithinContext(accessor => accessor.get(IInstantiationService).createInstance(DocumentSymbolsOutline, editor, target, firstLoadBarrier));
|
|
364
|
-
await firstLoadBarrier.wait();
|
|
365
|
-
return result;
|
|
366
|
-
}
|
|
367
|
-
};
|
|
368
|
-
DocumentSymbolsOutlineCreator = ( __decorate([
|
|
369
|
-
( __param(0, IOutlineService))
|
|
370
|
-
], DocumentSymbolsOutlineCreator));
|
|
371
|
-
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(DocumentSymbolsOutlineCreator, 4 );
|
package/vscode/src/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsTree.css.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import n from '../../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
|
|
2
|
-
|
|
3
|
-
var css = ".monaco-list .monaco-list-row.focused.selected .outline-element .monaco-highlighted-label,.monaco-list .monaco-list-row.focused.selected .outline-element-decoration{color:inherit!important}.monaco-list .outline-element{align-items:center;display:flex;flex:1;flex-flow:row nowrap}.monaco-list .outline-element .monaco-highlighted-label{color:var(--outline-element-color)}.monaco-breadcrumbs .outline-element .outline-element-decoration,.monaco-list .outline-element .outline-element-decoration{color:var(--outline-element-color);font-size:90%;font-weight:600;margin-left:auto;opacity:.75;padding:0 12px 0 5px;text-align:center}.monaco-breadcrumbs .outline-element .monaco-icon-label-container .monaco-icon-description-container,.monaco-breadcrumbs .outline-element .outline-element-decoration{display:none}.monaco-list .outline-element .outline-element-decoration.bubble{font-family:codicon;font-size:14px;opacity:.4;padding-right:8px}.monaco-list .outline-element .outline-element-icon{margin-right:4px}";
|
|
4
|
-
n(css,{});
|
|
5
|
-
|
|
6
|
-
export { css, css as default };
|