Regex search across files. scope='code' skips comments/strings.
(pattern: str, max_matches: int = 50, scope: str = "all", file: str | None = None)
| 450 | |
| 451 | |
| 452 | def grep(pattern: str, max_matches: int = 50, scope: str = "all", file: str | None = None): |
| 453 | """Regex search across files. scope='code' skips comments/strings.""" |
| 454 | state = _load_state() |
| 455 | params = {"pattern": pattern, "max_matches": max_matches, "scope": scope} |
| 456 | if file: |
| 457 | params["file"] = file |
| 458 | result = _safe_get(state, "/grep", params) |
| 459 | print(json.dumps(result, indent=2)) |
| 460 | return result |
| 461 | |
| 462 | |
| 463 | def symbols(file: str | None = None, kind: str | None = None, limit: int = 100): |
nothing calls this directly
no test coverage detected