get_symbol_source
Retrieve the source code of the symbol at a given cursor position. Uses LSP symbol tree to find the smallest enclosing function, method, class, or struct and returns its source with metadata.
Instructions
Return the source code of the innermost symbol (function, method, class, struct, etc.) whose range contains the given cursor position. Calls textDocument/documentSymbol, walks the symbol tree to find the smallest enclosing symbol, then slices the file at that symbol's range. Returns symbol_name, symbol_kind, start_line (1-based), end_line (1-based), and source text. Use line+character or position_pattern (@@-syntax) to specify the cursor. character defaults to 1.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| language_id | No | ||
| line | No | ||
| character | No | ||
| position_pattern | No |