* The precise symbol tokens a query names, excluding the files it names * (`editorOptions.ts` is identifier-shaped too). Split on the same brackets * the seeder splits on, so `clampedInt()` still counts.
(tokens: readonly string[], indexedBasenames: ReadonlySet<string>)
| 136 | * the seeder splits on, so `clampedInt()` still counts. |
| 137 | */ |
| 138 | function querySymbolTokens(tokens: readonly string[], indexedBasenames: ReadonlySet<string>): string[] { |
| 139 | const out = new Set<string>(); |
| 140 | for (const raw of tokens) { |
| 141 | for (const part of raw.split(/[,()[\]{}]+/)) { |
| 142 | const t = part.replace(/^['"`<]+/, '').replace(/['"`>.,;:!?]+$/, ''); |
| 143 | if (t.length < 3 || !SYMBOL_TOKEN.test(t) || !isPreciseSymbolToken(t)) continue; |
| 144 | if (indexedBasenames.has(t.toLowerCase())) continue; |
| 145 | out.add(t); |
| 146 | if (out.size >= MAX_SYMBOL_TOKENS) return [...out]; |
| 147 | } |
| 148 | } |
| 149 | return [...out]; |
| 150 | } |
| 151 | |
| 152 | /** |
| 153 | * Lowercased basename stems of the hyphen-named indexed files, stem → paths. |
no test coverage detected