Add useRipgrep config option
MODIFY
lib/project/results-model.js
lib/project/results-model.js
@@ -216,6 +216,7 @@ module.exports = class ResultsModel {
const trailingContextLineCount = atom.config.get('find-and-replace.searchContextLineCountAfter')
const startTime = Date.now()
+ const useRipgrep = atom.config.get('find-and-replace.useRipgrep')
this.inProgressSearchPromise = atom.workspace.scan(
this.regex,
@@ -223,6 +224,7 @@ module.exports = class ResultsModel {
paths: searchPaths,
onPathsSearched,
leadingContextLineCount,
+ ripgrep: useRipgrep,
trailingContextLineCount
},
(result, error) => {
@@ -244,7 +246,11 @@ module.exports = class ResultsModel {
} else {
const resultsSummary = this.getResultsSummary()
- this.metricsReporter.sendSearchEvent(Date.now() - startTime, resultsSummary.matchCount)
+ this.metricsReporter.sendSearchEvent(
+ Date.now() - startTime,
+ resultsSummary.matchCount,
+ useRipgrep ? 'ripgrep' : 'standard'
+ )
this.inProgressSearchPromise = null
this.emitter.emit('did-finish-searching', resultsSummary)
}

MODIFY
lib/reporter-proxy.js
lib/reporter-proxy.js
@@ -19,10 +19,11 @@ module.exports = class ReporterProxy {
delete this.reporter
}
- sendSearchEvent (duration, numResults) {
+ sendSearchEvent (duration, numResults, crawler) {
const metadata = {
ec: 'time-to-search',
- ev: numResults
+ ev: numResults,
+ el: crawler
}
this._addTiming(duration, metadata)

MODIFY
package.json
package.json
"title": "Show Search Wrap Icon",
"description": "Display a visual cue over the editor when looping through search results."
},
+ "useRipgrep": {
+ "type": "boolean",
+ "default": false,
+ "title": "Use ripgrep",
+ "description": "Use the experimental `ripgrep` search crawler. This will make searches substantially faster on large projects."
+ },
"autocompleteSearches": {
"type": "boolean",
"default": false,

Add useRipgrep config option