-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Description
Description
When the AL LSP returns a null/empty result for a hover request (which is valid LSP behavior when there's nothing to hover on), Claude Code crashes with:
Error performing hover: undefined is not an Object. (evaluating '"kind"in H')
Reproduction Steps
- Install AL LSP plugin (al-language-server-go-windows v1.3.12)
- Open any AL file (e.g., a Table or Codeunit)
- Call hover on a position with content (e.g., table name, variable, or type) → Works correctly
- Call hover on a position without content (empty line, whitespace, or position with no hover info) → Crashes
Environment
- OS: Windows
- Claude Code Version: Latest (2.x)
- AL LSP Plugin Version: 1.3.12
Root Cause Analysis
The Go wrapper logs show successful request/response flow:
Received from client: method=textDocument/hover
Sending request to AL LSP: method=textDocument/hover
Received response from AL LSP
Sending response to client
The wrapper is correctly forwarding the response. The crash happens in Claude Code's JavaScript code when it tries to check "kind" in H where H (the hover contents) is undefined/null.
Suggested Fix
The wrapper could potentially work around this by:
- Checking if the AL LSP returns null/empty for hover
- Returning a valid but empty MarkupContent structure, e.g.:
{"contents": {"kind": "plaintext", "value": ""}}
This would prevent Claude Code from crashing while the upstream bug in Claude Code is addressed.
Related
This is ultimately a bug in Claude Code's LSP handler (not handling null hover responses), but a workaround in the wrapper would help AL LSP users immediately.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels