(glob: string)
| 15 | } |
| 16 | |
| 17 | function globToFileRegexp(glob: string): string { |
| 18 | const re = globToRegexp(glob, { extended: true, globstar: true }); |
| 19 | // Strip ^ anchor — Sourcebot file paths include the full repo-relative path, |
| 20 | // so the pattern shouldn't be anchored to the start. |
| 21 | return re.source.replace(/^\^/, ''); |
| 22 | } |
| 23 | |
| 24 | function buildRipgrepCommand({ pattern, path, include }: SearchInput): string { |
| 25 | const parts = ['rg', `"${pattern.replace(/"/g, '\\"')}"`]; |