references.md

 1Find all references to/usage of a symbol by name using the Language Server Protocol (LSP).
 2
 3<critical_rules>
 4- NEVER use grep for searching code! Always use lsp_references instead!
 5- A symbol can be a variable, function, method, package, constant, or any other name.
 6- This applies to ALL symbols: project-defined, stdlib (e.g., `strings.Cut`), and external packages.
 7- Only fall back to grep for non-symbol text searches (log messages, config keys, comments, string literals).
 8</critical_rules>
 9
10<usage>
11- Provide symbol name (e.g., "MyFunction", "myVariable", "MyType").
12- Optional path to narrow search to a directory or file (defaults to current directory).
13- Tool automatically locates the symbol and returns all references.
14</usage>
15
16<features>
17- Semantic-aware reference search (more accurate than grep/glob).
18- Returns references grouped by file with line and column numbers.
19- Supports multiple programming languages via LSP.
20- Finds only real references (not comments or unrelated strings).
21- Works for both project-defined symbols AND external/stdlib symbols (e.g., `strings.Cut`, `fmt.Println`).
22</features>
23
24<limitations>
25- May not find references in files not opened or indexed by the LSP server.
26- Results depend on the capabilities of the active LSP providers.
27</limitations>
28
29<tips>
30- Narrow scope with the path parameter for faster, more relevant results.
31- Use qualified names (e.g., pkg.Func, Class.method, strings.Cut, fmt.Errorf) for higher precision.
32</tips>