Login
View Ticket
Login
Ticket Hash: 0b8d03b94ee7f6bbee0f1be19aae317a900f484a
Title: LSP unit 2: textDocument/definition via the existing find_symbol + stdlib-index.json lookup
Status: Active Type: Feature_Request
Severity: Normal Priority: Medium
Subsystem: Resolution:
Last Modified: 2026-09-20 14:42:31
51.7 days ago
Created: 2026-07-07 23:17:56
126.4 days ago
Version Found In:
Description:
Second unit of ticket 7d8c7145c436, depends on LSP unit 1 (the lsp_server.cr loop). Implement `textDocument/definition`: extract the identifier at the given position from the file text (word boundary scan, include :: paths), then resolve it with the SAME code paths the agent tools already use — AgentTool find_symbol (src/agent_tool.cr, project symbols) first, falling back to the stdlib index (agent-docs/stdlib-index.json via the existing loader). Return Location[] with file URI + zero-based range; empty array when unresolved (never an error). Spec: a fixture .cr file defining a class + method, a fake framed definition request, assert the returned location points at the definition line; and an unresolvable identifier yields []. Keep it pure lookup — no type inference, no compiler invocation.