11import { findActualExecutable } from 'spawn-rx'
2+ import { rgPath as vsCodeRgPath } from '@vscode/ripgrep'
23import { memoize } from 'lodash-es'
3- import { fileURLToPath , resolve } from 'node:url'
4- import * as path from 'path'
54import { logError } from './log'
65import { execFileNoThrow } from './execFileNoThrow'
76import { execFile } from 'child_process'
87import debug from 'debug'
98
10- const __filename = fileURLToPath ( import . meta. url )
11- const __dirname = resolve (
12- __filename ,
13- process . env . NODE_ENV === 'test' ? '../..' : '.' ,
14- )
15-
169const d = debug ( 'claude:ripgrep' )
1710
1811const useBuiltinRipgrep = ! ! process . env . USE_BUILTIN_RIPGREP
@@ -29,21 +22,9 @@ const ripgrepPath = memoize(() => {
2922 // path rather than just returning 'rg'
3023 return cmd
3124 } else {
32- // Use the one we ship in-box
33- const rgRoot = path . resolve ( __dirname , 'vendor' , 'ripgrep' )
34- if ( process . platform === 'win32' ) {
35- // NB: Ripgrep doesn't ship an aarch64 binary for Windows, boooooo
36- return path . resolve ( rgRoot , 'x64-win32' , 'rg.exe' )
37- }
38-
39- const ret = path . resolve (
40- rgRoot ,
41- `${ process . arch } -${ process . platform } ` ,
42- 'rg' ,
43- )
44-
45- d ( 'internal ripgrep resolved as: %s' , ret )
46- return ret
25+ // Use @vscode /ripgrep which auto-downloads platform-specific binary
26+ d ( 'Using @vscode/ripgrep: %s' , vsCodeRgPath )
27+ return vsCodeRgPath
4728 }
4829} )
4930
0 commit comments