You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Utilities for managing file-set filters, as used in Find in Files.Includes both UI for selecting/editing filters, as well as the actual file-filtering implementation.
9
+
Utilities for managing file-set filters, as used in Find in Files.
10
+
Includes both UI for selecting/editing filters, as well as the actual file-filtering implementation.
11
+
12
+
**Kind**: global constant
13
+
<aname="FILTER_TYPE_EXCLUDE"></a>
14
+
15
+
## FILTER\_TYPE\_EXCLUDE : <code>string</code>
16
+
**Kind**: global constant
17
+
<aname="FILTER_TYPE_INCLUDE"></a>
18
+
19
+
## FILTER\_TYPE\_INCLUDE : <code>string</code>
20
+
**Kind**: global constant
21
+
<aname="FILTER_TYPE_NO_FILTER"></a>
18
22
23
+
## FILTER\_TYPE\_NO\_FILTER : <code>string</code>
19
24
**Kind**: global constant
20
25
<aname="getActiveFilter"></a>
21
26
22
27
## getActiveFilter() ⇒ <code>Object</code>
23
-
A search filter is an array of one or more glob strings. The filter must be 'compiled' via compile()before passing to filterPath()/filterFileList().
28
+
A search filter is an array of one or more glob strings. The filter must be 'compiled' via compile()
29
+
before passing to filterPath()/filterFileList().
24
30
25
31
**Kind**: global function
26
32
**Returns**: <code>Object</code> - a globeFilter filter that can be passed to filterPath()/filterFileList().
27
33
<aname="setActiveFilter"></a>
28
34
29
35
## setActiveFilter(filter, [filterType])
30
-
Sets and save the index of the active filter. Automatically set when editFilter() is completed.If no filter is passed in, then clear the last active filter index by setting it to -1.
36
+
Sets and save the index of the active filter. Automatically set when editFilter() is completed.
37
+
If no filter is passed in, then clear the last active filter index by setting it to -1.
31
38
32
39
**Kind**: global function
33
40
@@ -39,7 +46,8 @@ Sets and save the index of the active filter. Automatically set when editFilter(
Converts a user-specified filter object (as chosen in picker or retrieved from getFilters()) to a 'compiled' formthat can be used with filterPath()/filterFileList().
49
+
Converts a user-specified filter object (as chosen in picker or retrieved from getFilters()) to a 'compiled' form
50
+
that can be used with filterPath()/filterFileList().
43
51
44
52
**Kind**: global function
45
53
**Returns**: <code>Object</code> - a globeFilter filter that can be passed to filterPath()/filterFileList().
@@ -51,7 +59,9 @@ Converts a user-specified filter object (as chosen in picker or retrieved from g
Returns false if the given path matches any of the exclusion globs in the given filter. Returns trueif the path does not match any of the globs. If filtering many paths at once, use filterFileList()for much better performance.
62
+
Returns false if the given path matches any of the exclusion globs in the given filter. Returns true
63
+
if the path does not match any of the globs. If filtering many paths at once, use filterFileList()
64
+
for much better performance.
55
65
56
66
**Kind**: global function
57
67
@@ -87,7 +97,10 @@ Returns a copy of 'file path' strings that match any of the exclusion globs in t
Creates a UI element for selecting a filter. The picker is populated with a list of recently used filters,an option to edit the selected filter, and another option to create a new filter. The client should call`commitDropdown()` when the UI containing the filter picker is confirmed, which updates the Most Recently Used (MRU) order, and then use the returned filter object as needed.
100
+
Creates a UI element for selecting a filter. The picker is populated with a list of recently used filters,
101
+
an option to edit the selected filter, and another option to create a new filter. The client should call
102
+
`commitDropdown()` when the UI containing the filter picker is confirmed, which updates the Most Recently
103
+
Used (MRU) order, and then use the returned filter object as needed.
91
104
92
105
**Kind**: global function
93
106
**Returns**: <code>jQueryObject</code> - The Picker UI as a jQuery object.
Find Bar UI component, used for both single- and multi-file find/replace. This doesn't actuallycreate and add the FindBar to the DOM - for that, call open().Dispatches these events:- queryChange - when the user types in the input field or sets a query option. Use getQueryInfo() to get the current query state.- doFind - when the user chooses to do a Find Previous or Find Next. Parameters are: shiftKey - boolean, false for Find Next, true for Find Previous- doReplace - when the user chooses to do a single replace. Use getReplaceText() to get the current replacement text.- doReplaceBatch - when the user chooses to initiate a Replace All. Use getReplaceText() to get the current replacement text.- doReplaceAll - when the user chooses to perform a Replace All. Use getReplaceText() to get the current replacement text.- close - when the find bar is closed
35
+
Find Bar UI component, used for both single- and multi-file find/replace. This doesn't actually
36
+
create and add the FindBar to the DOM - for that, call open().
37
+
38
+
Dispatches these events:
39
+
40
+
- queryChange - when the user types in the input field or sets a query option. Use getQueryInfo()
41
+
to get the current query state.
42
+
- doFind - when the user chooses to do a Find Previous or Find Next.
43
+
Parameters are:
44
+
shiftKey - boolean, false for Find Next, true for Find Previous
45
+
- doReplace - when the user chooses to do a single replace. Use getReplaceText() to get the current replacement text.
46
+
- doReplaceBatch - when the user chooses to initiate a Replace All. Use getReplaceText() to get the current replacement text.
47
+
- doReplaceAll - when the user chooses to perform a Replace All. Use getReplaceText() to get the current replacement text.
Show or hide the no-results indicator and optional message. This is also used toindicate regular expression errors.
119
+
Show or hide the no-results indicator and optional message. This is also used to
120
+
indicate regular expression errors.
110
121
111
122
**Kind**: instance method of [<code>FindBar</code>](#FindBar)
112
123
@@ -124,7 +135,9 @@ Returns the current replace text.
124
135
<aname="FindBar+enable"></a>
125
136
126
137
### findBar.enable(enable)
127
-
Enables or disables the controls in the Find bar. Note that if enable is true, *all* controls will bere-enabled, even if some were previously disabled using enableNavigation() or enableReplace(), so youwill need to refresh their enable state after calling this.
138
+
Enables or disables the controls in the Find bar. Note that if enable is true, *all* controls will be
139
+
re-enabled, even if some were previously disabled using enableNavigation() or enableReplace(), so you
140
+
will need to refresh their enable state after calling this.
128
141
129
142
**Kind**: instance method of [<code>FindBar</code>](#FindBar)
130
143
@@ -145,7 +158,8 @@ Enables or disables the controls in the Find bar. Note that if enable is true, *
145
158
<aname="FindBar+enableNavigation"></a>
146
159
147
160
### findBar.enableNavigation(enable)
148
-
Enable or disable the navigation controls if present. Note that if the Find bar is currently disabled(i.e. isEnabled() returns false), this will have no effect.
161
+
Enable or disable the navigation controls if present. Note that if the Find bar is currently disabled
162
+
(i.e. isEnabled() returns false), this will have no effect.
149
163
150
164
**Kind**: instance method of [<code>FindBar</code>](#FindBar)
151
165
@@ -156,7 +170,8 @@ Enable or disable the navigation controls if present. Note that if the Find bar
156
170
<aname="FindBar+enableReplace"></a>
157
171
158
172
### findBar.enableReplace(enable)
159
-
Enable or disable the replace controls if present. Note that if the Find bar is currently disabled(i.e. isEnabled() returns false), this will have no effect.
173
+
Enable or disable the replace controls if present. Note that if the Find bar is currently disabled
174
+
(i.e. isEnabled() returns false), this will have no effect.
160
175
161
176
**Kind**: instance method of [<code>FindBar</code>](#FindBar)
162
177
@@ -188,16 +203,3 @@ The indexing spinner is usually shown when node is indexing files
188
203
Force a search again
189
204
190
205
**Kind**: instance method of [<code>FindBar</code>](#FindBar)
Checks that the file matches the given subtree scope. To fully check whether the fileshould be in the search set, use _inSearchScope() instead - a supserset of this.
58
-
59
-
**Kind**: global function
60
-
61
-
| Param | Type | Description |
62
-
| --- | --- | --- |
63
-
| file | <code>File</code> ||
64
-
| scope | <code>FileSystemEntry</code> | Search scope, or null if whole project |
Finds all candidate files to search in the given scope's subtree that are not binary content. Does NOT applythe current filter yet.
21
+
Finds all candidate files to search in the given scope's subtree that are not binary content. Does NOT apply
22
+
the current filter yet.
82
23
83
24
**Kind**: global function
84
25
**Returns**: <code>$.Promise</code> - A promise that will be resolved with the list of files in the scope. Never rejected.
@@ -87,21 +28,12 @@ Finds all candidate files to search in the given scope's subtree that are not bi
87
28
| --- | --- | --- |
88
29
| scope | <code>FileSystemEntry</code> | Search scope, or null if whole project |
89
30
90
-
<aname="_inSearchScope"></a>
91
-
92
-
## \_inSearchScope(file) ⇒ <code>boolean</code>
93
-
Checks that the file is eligible for inclusion in the search (matches the user's subtree scope andfile exclusion filters, and isn't binary). Used when updating results incrementally - during theinitial search, these checks are done in bulk via getCandidateFiles() and the filterFileList() callafter it.
Does a search in the given scope with the given filter. Used when you want to start a searchprogrammatically. Make sure that project indexing is complete by calling isProjectIndexingComplete()Else, an empty result will be returned if search is invoked before any files are indexed.
34
+
Does a search in the given scope with the given filter. Used when you want to start a search
35
+
programmatically. Make sure that project indexing is complete by calling isProjectIndexingComplete()
36
+
Else, an empty result will be returned if search is invoked before any files are indexed.
105
37
106
38
**Kind**: global function
107
39
**Returns**: <code>$.Promise</code> - A promise that's resolved with the search results or rejected when the find competes.
@@ -120,7 +52,8 @@ Does a search in the given scope with the given filter. Used when you want to st
120
52
Replaces a set of search results with the specified `replaceText`, either on disk or in memory.
121
53
122
54
**Kind**: global function
123
-
**Returns**: <code>$.Promise</code> - A promise that resolves when the replacement is finished or is rejected with an array of errors if any occur. Each item in the array will be an object containing:
55
+
**Returns**: <code>$.Promise</code> - A promise that resolves when the replacement is finished or is rejected with an array of errors if any occur.
56
+
Each item in the array will be an object containing:
124
57
125
58
| Param | Type | Description |
126
59
| --- | --- | --- |
@@ -132,50 +65,17 @@ Replaces a set of search results with the specified `replaceText`, either on dis
132
65
| item | <code>string</code> | The full path to the file that could not be updated. |
133
66
| error | <code>string</code> | Either a FileSystem error or one of the `FindInFiles.ERROR_*` constants. |
134
67
135
-
<aname="_searchcollapseResults"></a>
136
-
137
-
## \_searchcollapseResults()
138
-
Notify worker that the results should be collapsed
139
-
140
-
**Kind**: global function
141
-
<aname="filesChanged"></a>
142
-
143
-
## filesChanged(fileList)
144
-
Inform worker that the list of files has changed.
145
-
146
-
**Kind**: global function
147
-
148
-
| Param | Type | Description |
149
-
| --- | --- | --- |
150
-
| fileList | <code>array</code> | The list of files that changed. |
151
-
152
-
<aname="filesRemoved"></a>
153
-
154
-
## filesRemoved(fileList)
155
-
Inform worker that the list of files have been removed.
156
-
157
-
**Kind**: global function
158
-
159
-
| Param | Type | Description |
160
-
| --- | --- | --- |
161
-
| fileList | <code>array</code> | The list of files that was removed. |
162
-
163
-
<aname="_debouncedFileSystemChangeHandler"></a>
164
-
165
-
## \_debouncedFileSystemChangeHandler()
166
-
Wrapper function for _fileSystemChangeHandler which handles all incoming fs eventsputting them to cache and executing a debounced function
167
-
168
-
**Kind**: global function
169
-
<aname="_initCache"></a>
170
-
171
-
## \_initCache()
172
-
On project change, inform worker about the new list of files that needs to be crawled.Instant search is also disabled for the time being till the crawl is complete in worker.This should never be called directly and only called via _scheduleCacheInit() belowto not affect project load performance.
0 commit comments