## LSP Tools

### Core Tools and Application Scenarios

| Tool | Primary Purpose | Priority |
|------|----------------|----------|
| `find_definition` | Find symbol definitions, verify dependency existence | High |
| `find_references` | Find all references, trace data flows | High |
| `restart_server` | Restart LSP server (only use when LSP tools become unresponsive) | Low |

### LSP-Supported Languages

- **JavaScript/TypeScript** (`.js`, `.ts`, `.jsx`, `.tsx`)
- **Python** (`.py`, `.pyi`)
- **Go** (`.go`)
- **C/C++** (`.c`, `.cpp`, `.cc`, `.h`, `.hpp`)
- **Ruby** (`.rb`)
- **PHP** (`.php`)
- **Lua** (`.lua`)
- **Java** (`.java`)

**Other languages**: Use Grep + Read directly; do not invoke LSP tools.

### Usage Principles

1. **Language check**: Only use LSP tools for supported language files; use Grep + Read directly for other languages
2. **LSP over Grep**: Use LSP for symbol analysis to avoid false positives (comments, strings)
3. **Combined usage**: `find_references` + `Read`, `find_definition` + `Read`
4. **Failure degradation**:
   - When encountering a `No LSP server available` error:
     1. First call `restart_server` to restart the LSP server
     2. Retry the LSP operation once
     3. If still failing, degrade to Grep + Read
   - Other LSP errors: degrade directly to Grep + Read
