references.md

 1Find all references to a symbol using LSP. More accurate than grep for code symbols.
 2
 3<when_to_use>
 4Use References when:
 5- Finding where a function/method is called
 6- Finding usages of a type, variable, or constant
 7- Understanding impact before renaming/refactoring
 8- Need semantic accuracy (grep finds strings, this finds actual references)
 9
10Do NOT use References when:
11- Searching for arbitrary text → use `grep`
12- Finding files by name → use `glob`
13- Symbol isn't in a language with LSP support
14</when_to_use>
15
16<parameters>
17- symbol: Name to search for (e.g., "MyFunction", "UserService", "configPath")
18- path: Directory to narrow search (optional, default: current directory)
19</parameters>
20
21<output>
22- References grouped by file
23- Line and column numbers for each usage
24- Only real code references (not comments or strings)
25</output>
26
27<tips>
28- Use qualified names for precision: "pkg.Function", "Class.method"
29- Narrow scope with path parameter for faster results
30- Works best with statically typed languages
31- Depends on LSP server capabilities and indexing
32</tips>
33
34<example>
35Before refactoring `handleRequest`:
36```
37symbol: "handleRequest"
38path: "src/handlers"
39```
40→ Shows all callers so you know what might break.
41</example>