Find clang-query, preferring direct binaries but falling back to uv.
()
| 165 | |
| 166 | |
| 167 | def _find_clang_query() -> list[str]: |
| 168 | """Find clang-query, preferring direct binaries but falling back to uv.""" |
| 169 | system_path = Path("C:/Program Files/LLVM/bin/clang-query.exe") |
| 170 | if system_path.exists(): |
| 171 | return [str(system_path)] |
| 172 | |
| 173 | cache_path = ( |
| 174 | PROJECT_ROOT / ".cache" / "clang-tools" / "clang" / "bin" / "clang-query.exe" |
| 175 | ) |
| 176 | if cache_path.exists(): |
| 177 | return [str(cache_path)] |
| 178 | |
| 179 | found = shutil.which("clang-query") |
| 180 | if found: |
| 181 | return [found] |
| 182 | |
| 183 | wrapper = shutil.which("clang-tool-chain-query") |
| 184 | if wrapper: |
| 185 | return [wrapper] |
| 186 | |
| 187 | uv = shutil.which("uv") |
| 188 | if uv: |
| 189 | return [uv, "run", "clang-tool-chain-query"] |
| 190 | |
| 191 | return [] |
| 192 | |
| 193 | |
| 194 | def _read_source_signature(filepath: str, line_num: int) -> tuple[str, str]: |
no outgoing calls
no test coverage detected