Skip to content

Conversation

@titanous
Copy link

@titanous titanous commented Aug 8, 2025

This fixes a couple issues with compatibility with the Dart language server and adds tests.

This was almost entirely written by Claude Code across a few sessions.

titanous and others added 3 commits August 8, 2025 14:22
The Dart Language Server returns hover contents as plain strings in some cases,
which was causing JSON unmarshalling errors. According to the LSP specification,
the hover contents field can be:
- MarkupContent (object with kind and value)
- MarkedString (plain string)
- MarkedString[] (array of strings or language/value objects)

Changes:
- Fixed code generation to use Or_Hover_contents union type instead of MarkupContent
- Updated hover.go to handle all possible content types from the LSP spec
- Added comprehensive Dart integration tests with 13 test cases
- Added Dart to GitHub Actions CI workflow
- Updated .gitignore for Dart artifacts

This ensures the MCP language server correctly handles all valid hover response
formats from any LSP server, not just those that return MarkupContent objects.

Fixes the issue where Dart hover functionality would fail with:
"json: cannot unmarshal string into Go struct field Hover.contents of type protocol.MarkupContent"

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Fixed Dart LSP definition lookup issues:
- Handle Dart's function/method naming convention (returns names with parentheses)
- Support qualified names like ClassName.methodName
- Extract definition text directly from workspace/symbol location
- Update hover test snapshot for comment change

Added comprehensive test coverage with 23 test cases covering classes,
functions, methods, enums, mixins, extensions, and typedefs.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
The pattern **/* should match all files, but the matching logic was
incorrectly checking if paths ended with a literal asterisk character.
Added special case handling to make **/* match everything, which fixes
the watcher tests.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant