@codingame/monaco-vscode-search-service-override 3.2.3 → 4.1.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 (35) hide show
  1. package/package.json +2 -2
  2. package/search.js +4 -4
  3. package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
  4. package/external/tslib/tslib.es6.js +0 -11
  5. package/override/vs/platform/dialogs/common/dialogs.js +0 -8
  6. package/vscode/src/vs/workbench/contrib/search/browser/anythingQuickAccess.js +0 -776
  7. package/vscode/src/vs/workbench/contrib/search/browser/media/anythingQuickAccess.css.js +0 -6
  8. package/vscode/src/vs/workbench/contrib/search/browser/media/searchview.css.js +0 -6
  9. package/vscode/src/vs/workbench/contrib/search/browser/patternInputWidget.js +0 -231
  10. package/vscode/src/vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess.js +0 -342
  11. package/vscode/src/vs/workbench/contrib/search/browser/replaceContributions.js +0 -8
  12. package/vscode/src/vs/workbench/contrib/search/browser/replaceService.js +0 -232
  13. package/vscode/src/vs/workbench/contrib/search/browser/search.contribution.js +0 -621
  14. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsCopy.js +0 -209
  15. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsNav.js +0 -511
  16. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsRemoveReplace.js +0 -374
  17. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsSymbol.js +0 -43
  18. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTextQuickAccess.js +0 -44
  19. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTopBar.js +0 -323
  20. package/vscode/src/vs/workbench/contrib/search/browser/searchFindInput.js +0 -47
  21. package/vscode/src/vs/workbench/contrib/search/browser/searchIcons.js +0 -96
  22. package/vscode/src/vs/workbench/contrib/search/browser/searchMessage.js +0 -66
  23. package/vscode/src/vs/workbench/contrib/search/browser/searchResultsView.js +0 -434
  24. package/vscode/src/vs/workbench/contrib/search/browser/searchView.js +0 -2096
  25. package/vscode/src/vs/workbench/contrib/search/browser/searchWidget.js +0 -667
  26. package/vscode/src/vs/workbench/contrib/search/browser/symbolsQuickAccess.js +0 -234
  27. package/vscode/src/vs/workbench/contrib/search/common/cacheState.js +0 -87
  28. package/vscode/src/vs/workbench/contrib/searchEditor/browser/media/searchEditor.css.js +0 -6
  29. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.js +0 -586
  30. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.js +0 -736
  31. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorActions.js +0 -189
  32. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorInput.js +0 -320
  33. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorModel.js +0 -138
  34. package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorSerialization.js +0 -293
  35. package/vscode/src/vs/workbench/services/search/common/searchService.js +0 -372
@@ -1,234 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
3
- import { PickerQuickAccessProvider, TriggerAction } from 'vscode/vscode/vs/platform/quickinput/browser/pickerQuickAccess';
4
- import { ThrottledDelayer } from 'vscode/vscode/vs/base/common/async';
5
- import { getWorkspaceSymbols } from 'vscode/vscode/vs/workbench/contrib/search/common/search';
6
- import { SymbolKinds } from 'vscode/vscode/vs/editor/common/languages';
7
- import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label';
8
- import { Schemas } from 'vscode/vscode/vs/base/common/network';
9
- import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener';
10
- import { SIDE_GROUP, ACTIVE_GROUP, IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
11
- import { Range } from 'vscode/vscode/vs/editor/common/core/range';
12
- import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
13
- import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
14
- import { getSelectionSearchString } from 'vscode/vscode/vs/editor/contrib/find/browser/findController';
15
- import { prepareQuery, pieceToQuery, scoreFuzzy2 } from 'vscode/vscode/vs/base/common/fuzzyScorer';
16
- import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
17
- import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
18
-
19
- var SymbolsQuickAccessProvider_1;
20
- let SymbolsQuickAccessProvider = class SymbolsQuickAccessProvider extends PickerQuickAccessProvider {
21
- static { SymbolsQuickAccessProvider_1 = this; }
22
- static { this.PREFIX = '#'; }
23
- static { this.TYPING_SEARCH_DELAY = 200; }
24
- static { this.TREAT_AS_GLOBAL_SYMBOL_TYPES = ( new Set([
25
- 4 ,
26
- 9 ,
27
- 0 ,
28
- 10 ,
29
- 2 ,
30
- 3 ,
31
- 1
32
- ])); }
33
- get defaultFilterValue() {
34
- const editor = this.codeEditorService.getFocusedCodeEditor();
35
- if (editor) {
36
- return getSelectionSearchString(editor) ?? undefined;
37
- }
38
- return undefined;
39
- }
40
- constructor(labelService, openerService, editorService, configurationService, codeEditorService) {
41
- super(SymbolsQuickAccessProvider_1.PREFIX, {
42
- canAcceptInBackground: true,
43
- noResultsPick: {
44
- label: ( localizeWithPath(
45
- 'vs/workbench/contrib/search/browser/symbolsQuickAccess',
46
- 'noSymbolResults',
47
- "No matching workspace symbols"
48
- ))
49
- }
50
- });
51
- this.labelService = labelService;
52
- this.openerService = openerService;
53
- this.editorService = editorService;
54
- this.configurationService = configurationService;
55
- this.codeEditorService = codeEditorService;
56
- this.delayer = this._register(( new ThrottledDelayer(SymbolsQuickAccessProvider_1.TYPING_SEARCH_DELAY)));
57
- }
58
- get configuration() {
59
- const editorConfig = this.configurationService.getValue().workbench?.editor;
60
- return {
61
- openEditorPinned: !editorConfig?.enablePreviewFromQuickOpen || !editorConfig?.enablePreview,
62
- openSideBySideDirection: editorConfig?.openSideBySideDirection
63
- };
64
- }
65
- _getPicks(filter, disposables, token) {
66
- return this.getSymbolPicks(filter, undefined, token);
67
- }
68
- async getSymbolPicks(filter, options, token) {
69
- return this.delayer.trigger(async () => {
70
- if (token.isCancellationRequested) {
71
- return [];
72
- }
73
- return this.doGetSymbolPicks(prepareQuery(filter), options, token);
74
- }, options?.delay);
75
- }
76
- async doGetSymbolPicks(query, options, token) {
77
- let symbolQuery;
78
- let containerQuery;
79
- if (query.values && query.values.length > 1) {
80
- symbolQuery = pieceToQuery(query.values[0]);
81
- containerQuery = pieceToQuery(query.values.slice(1));
82
- }
83
- else {
84
- symbolQuery = query;
85
- }
86
- const workspaceSymbols = await getWorkspaceSymbols(symbolQuery.original, token);
87
- if (token.isCancellationRequested) {
88
- return [];
89
- }
90
- const symbolPicks = [];
91
- const openSideBySideDirection = this.configuration.openSideBySideDirection;
92
- for (const { symbol, provider } of workspaceSymbols) {
93
- if (options?.skipLocal && !( SymbolsQuickAccessProvider_1.TREAT_AS_GLOBAL_SYMBOL_TYPES.has(symbol.kind)) && !!symbol.containerName) {
94
- continue;
95
- }
96
- const symbolLabel = symbol.name;
97
- const symbolLabelWithIcon = `$(${SymbolKinds.toIcon(symbol.kind).id}) ${symbolLabel}`;
98
- const symbolLabelIconOffset = symbolLabelWithIcon.length - symbolLabel.length;
99
- let symbolScore = undefined;
100
- let symbolMatches = undefined;
101
- let skipContainerQuery = false;
102
- if (symbolQuery.original.length > 0) {
103
- if (symbolQuery !== query) {
104
- [symbolScore, symbolMatches] = scoreFuzzy2(symbolLabelWithIcon, { ...query, values: undefined }, 0, symbolLabelIconOffset);
105
- if (typeof symbolScore === 'number') {
106
- skipContainerQuery = true;
107
- }
108
- }
109
- if (typeof symbolScore !== 'number') {
110
- [symbolScore, symbolMatches] = scoreFuzzy2(symbolLabelWithIcon, symbolQuery, 0, symbolLabelIconOffset);
111
- if (typeof symbolScore !== 'number') {
112
- continue;
113
- }
114
- }
115
- }
116
- const symbolUri = symbol.location.uri;
117
- let containerLabel = undefined;
118
- if (symbolUri) {
119
- const containerPath = this.labelService.getUriLabel(symbolUri, { relative: true });
120
- if (symbol.containerName) {
121
- containerLabel = `${symbol.containerName} • ${containerPath}`;
122
- }
123
- else {
124
- containerLabel = containerPath;
125
- }
126
- }
127
- let containerScore = undefined;
128
- let containerMatches = undefined;
129
- if (!skipContainerQuery && containerQuery && containerQuery.original.length > 0) {
130
- if (containerLabel) {
131
- [containerScore, containerMatches] = scoreFuzzy2(containerLabel, containerQuery);
132
- }
133
- if (typeof containerScore !== 'number') {
134
- continue;
135
- }
136
- if (typeof symbolScore === 'number') {
137
- symbolScore += containerScore;
138
- }
139
- }
140
- const deprecated = symbol.tags ? symbol.tags.indexOf(1 ) >= 0 : false;
141
- symbolPicks.push({
142
- symbol,
143
- resource: symbolUri,
144
- score: symbolScore,
145
- label: symbolLabelWithIcon,
146
- ariaLabel: symbolLabel,
147
- highlights: deprecated ? undefined : {
148
- label: symbolMatches,
149
- description: containerMatches
150
- },
151
- description: containerLabel,
152
- strikethrough: deprecated,
153
- buttons: [
154
- {
155
- iconClass: openSideBySideDirection === 'right' ? ThemeIcon.asClassName(Codicon.splitHorizontal) : ThemeIcon.asClassName(Codicon.splitVertical),
156
- tooltip: openSideBySideDirection === 'right' ? ( localizeWithPath(
157
- 'vs/workbench/contrib/search/browser/symbolsQuickAccess',
158
- 'openToSide',
159
- "Open to the Side"
160
- )) : ( localizeWithPath(
161
- 'vs/workbench/contrib/search/browser/symbolsQuickAccess',
162
- 'openToBottom',
163
- "Open to the Bottom"
164
- ))
165
- }
166
- ],
167
- trigger: (buttonIndex, keyMods) => {
168
- this.openSymbol(provider, symbol, token, { keyMods, forceOpenSideBySide: true });
169
- return TriggerAction.CLOSE_PICKER;
170
- },
171
- accept: async (keyMods, event) => this.openSymbol(provider, symbol, token, { keyMods, preserveFocus: event.inBackground, forcePinned: event.inBackground }),
172
- });
173
- }
174
- if (!options?.skipSorting) {
175
- symbolPicks.sort((symbolA, symbolB) => this.compareSymbols(symbolA, symbolB));
176
- }
177
- return symbolPicks;
178
- }
179
- async openSymbol(provider, symbol, token, options) {
180
- let symbolToOpen = symbol;
181
- if (typeof provider.resolveWorkspaceSymbol === 'function') {
182
- symbolToOpen = (await provider.resolveWorkspaceSymbol(symbol, token)) || symbol;
183
- if (token.isCancellationRequested) {
184
- return;
185
- }
186
- }
187
- if (symbolToOpen.location.uri.scheme === Schemas.http || symbolToOpen.location.uri.scheme === Schemas.https) {
188
- await this.openerService.open(symbolToOpen.location.uri, { fromUserGesture: true, allowContributedOpeners: true });
189
- }
190
- else {
191
- await this.editorService.openEditor({
192
- resource: symbolToOpen.location.uri,
193
- options: {
194
- preserveFocus: options?.preserveFocus,
195
- pinned: options.keyMods.ctrlCmd || options.forcePinned || this.configuration.openEditorPinned,
196
- selection: symbolToOpen.location.range ? Range.collapseToStart(symbolToOpen.location.range) : undefined
197
- }
198
- }, options.keyMods.alt || (this.configuration.openEditorPinned && options.keyMods.ctrlCmd) || options?.forceOpenSideBySide ? SIDE_GROUP : ACTIVE_GROUP);
199
- }
200
- }
201
- compareSymbols(symbolA, symbolB) {
202
- if (typeof symbolA.score === 'number' && typeof symbolB.score === 'number') {
203
- if (symbolA.score > symbolB.score) {
204
- return -1;
205
- }
206
- if (symbolA.score < symbolB.score) {
207
- return 1;
208
- }
209
- }
210
- if (symbolA.symbol && symbolB.symbol) {
211
- const symbolAName = symbolA.symbol.name.toLowerCase();
212
- const symbolBName = symbolB.symbol.name.toLowerCase();
213
- const res = symbolAName.localeCompare(symbolBName);
214
- if (res !== 0) {
215
- return res;
216
- }
217
- }
218
- if (symbolA.symbol && symbolB.symbol) {
219
- const symbolAKind = SymbolKinds.toIcon(symbolA.symbol.kind).id;
220
- const symbolBKind = SymbolKinds.toIcon(symbolB.symbol.kind).id;
221
- return symbolAKind.localeCompare(symbolBKind);
222
- }
223
- return 0;
224
- }
225
- };
226
- SymbolsQuickAccessProvider = SymbolsQuickAccessProvider_1 = ( __decorate([
227
- ( __param(0, ILabelService)),
228
- ( __param(1, IOpenerService)),
229
- ( __param(2, IEditorService)),
230
- ( __param(3, IConfigurationService)),
231
- ( __param(4, ICodeEditorService))
232
- ], SymbolsQuickAccessProvider));
233
-
234
- export { SymbolsQuickAccessProvider };
@@ -1,87 +0,0 @@
1
- import { defaultGenerator } from 'vscode/vscode/vs/base/common/idGenerator';
2
- import { equals } from 'vscode/vscode/vs/base/common/objects';
3
-
4
- var LoadingPhase;
5
- ( (function(LoadingPhase) {
6
- LoadingPhase[LoadingPhase["Created"] = 1] = "Created";
7
- LoadingPhase[LoadingPhase["Loading"] = 2] = "Loading";
8
- LoadingPhase[LoadingPhase["Loaded"] = 3] = "Loaded";
9
- LoadingPhase[LoadingPhase["Errored"] = 4] = "Errored";
10
- LoadingPhase[LoadingPhase["Disposed"] = 5] = "Disposed";
11
- })(LoadingPhase || (LoadingPhase = {})));
12
- class FileQueryCacheState {
13
- get cacheKey() {
14
- if (this.loadingPhase === LoadingPhase.Loaded || !this.previousCacheState) {
15
- return this._cacheKey;
16
- }
17
- return this.previousCacheState.cacheKey;
18
- }
19
- get isLoaded() {
20
- const isLoaded = this.loadingPhase === LoadingPhase.Loaded;
21
- return isLoaded || !this.previousCacheState ? isLoaded : this.previousCacheState.isLoaded;
22
- }
23
- get isUpdating() {
24
- const isUpdating = this.loadingPhase === LoadingPhase.Loading;
25
- return isUpdating || !this.previousCacheState ? isUpdating : this.previousCacheState.isUpdating;
26
- }
27
- constructor(cacheQuery, loadFn, disposeFn, previousCacheState) {
28
- this.cacheQuery = cacheQuery;
29
- this.loadFn = loadFn;
30
- this.disposeFn = disposeFn;
31
- this.previousCacheState = previousCacheState;
32
- this._cacheKey = defaultGenerator.nextId();
33
- this.query = this.cacheQuery(this._cacheKey);
34
- this.loadingPhase = LoadingPhase.Created;
35
- if (this.previousCacheState) {
36
- const current = Object.assign({}, this.query, { cacheKey: null });
37
- const previous = Object.assign({}, this.previousCacheState.query, { cacheKey: null });
38
- if (!equals(current, previous)) {
39
- this.previousCacheState.dispose();
40
- this.previousCacheState = undefined;
41
- }
42
- }
43
- }
44
- load() {
45
- if (this.isUpdating) {
46
- return this;
47
- }
48
- this.loadingPhase = LoadingPhase.Loading;
49
- this.loadPromise = (async () => {
50
- try {
51
- await this.loadFn(this.query);
52
- this.loadingPhase = LoadingPhase.Loaded;
53
- if (this.previousCacheState) {
54
- this.previousCacheState.dispose();
55
- this.previousCacheState = undefined;
56
- }
57
- }
58
- catch (error) {
59
- this.loadingPhase = LoadingPhase.Errored;
60
- throw error;
61
- }
62
- })();
63
- return this;
64
- }
65
- dispose() {
66
- if (this.loadPromise) {
67
- (async () => {
68
- try {
69
- await this.loadPromise;
70
- }
71
- catch (error) {
72
- }
73
- this.loadingPhase = LoadingPhase.Disposed;
74
- this.disposeFn(this._cacheKey);
75
- })();
76
- }
77
- else {
78
- this.loadingPhase = LoadingPhase.Disposed;
79
- }
80
- if (this.previousCacheState) {
81
- this.previousCacheState.dispose();
82
- this.previousCacheState = undefined;
83
- }
84
- }
85
- }
86
-
87
- export { FileQueryCacheState };
@@ -1,6 +0,0 @@
1
- import n from '../../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
2
-
3
- var css = ".search-editor{display:flex;flex-direction:column}.search-editor .search-results{flex:1}.search-editor .query-container{margin:0 12px 12px 19px;padding-top:6px}.search-editor .search-widget .toggle-replace-button{align-items:center;background-position:50%;background-repeat:no-repeat;box-sizing:border-box;cursor:pointer;display:flex;height:100%;justify-content:center;left:0;position:absolute;top:0;width:16px}.search-editor .search-widget .replace-container,.search-editor .search-widget .search-container{align-items:center;display:flex}.search-editor .search-widget .monaco-findInput{display:inline-block;vertical-align:middle;width:100%}.search-editor .search-widget .monaco-inputbox>.ibwrapper{height:100%}.search-editor .search-widget .monaco-inputbox>.ibwrapper>.mirror,.search-editor .search-widget .monaco-inputbox>.ibwrapper>textarea.input{padding:3px 3px 3px 6px}.search-editor .search-widget .monaco-inputbox>.ibwrapper>.mirror{max-height:134px}.search-editor .search-widget .monaco-inputbox>.ibwrapper>textarea.input{height:26px;overflow:initial}.search-editor .monaco-inputbox>.ibwrapper>textarea.input{scrollbar-width:none}.search-editor .monaco-inputbox>.ibwrapper>textarea.input::-webkit-scrollbar{display:none}.search-editor .search-widget .context-lines-input{margin-left:5px;margin-right:2px;max-width:50px}.search-editor .search-widget .context-lines-input input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none!important}.search-editor .search-widget .replace-container{display:inline-flex;margin-top:6px;position:relative}.search-editor .search-widget .replace-input{display:flex;height:25px;position:relative;vertical-align:middle;width:auto!important}.search-editor .search-widget .replace-input>.controls{position:absolute;right:2px;top:3px}.search-editor .search-widget .replace-container.disabled{display:none}.search-editor .search-widget .replace-container .monaco-action-bar{height:25px;margin-left:0}.search-editor .search-widget .replace-container .monaco-action-bar .action-item .codicon{align-items:center;background-repeat:no-repeat;display:flex;height:25px;justify-content:center;margin-right:0;width:25px}.search-editor .includes-excludes{min-height:1em;position:relative}.search-editor .includes-excludes .expand{cursor:pointer;height:16px;position:absolute;right:-2px;width:25px;z-index:2}.search-editor .includes-excludes .file-types{display:none}.search-editor .includes-excludes.expanded .file-types{display:inherit}.search-editor .includes-excludes.expanded .file-types:last-child{padding-bottom:10px}.search-editor .includes-excludes.expanded h4{font-size:11px;font-weight:400;margin:0;overflow:hidden;padding:4px 0 0;text-overflow:ellipsis;white-space:nowrap}.search-editor .messages{cursor:default;margin-top:-5px}.search-editor .message{padding-left:7px;padding-right:22px;padding-top:0}.search-editor a.prominent{text-decoration:underline}.monaco-editor .searchEditorFindMatch{background-color:var(--vscode-searchEditor-findMatchBackground);border:1px solid var(--vscode-searchEditor-findMatchBorder);box-sizing:border-box}.monaco-editor.hc-black .searchEditorFindMatch,.monaco-editor.hc-light .searchEditorFindMatch{border:1px dotted var(--vscode-searchEditor-findMatchBorder)}";
4
- n(css,{});
5
-
6
- export { css, css as default };