Skip to content

fix(bridge): serialize CallHierarchyItemResult.kind as LSP integer - #117

Merged
bug-ops merged 1 commit into
mainfrom
112-call-hierarchy-kind-field
Apr 29, 2026
Merged

fix(bridge): serialize CallHierarchyItemResult.kind as LSP integer#117
bug-ops merged 1 commit into
mainfrom
112-call-hierarchy-kind-field

Conversation

@bug-ops

@bug-ops bug-ops commented Apr 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • Changed CallHierarchyItemResult.kind from String to u32
  • format!("{:?}", item.kind) produced debug strings like "Function" instead of LSP integer 12, causing serde_json::from_value::<CallHierarchyItem> to fail 100% of the time in get_incoming_calls and get_outgoing_calls
  • Now extracts numeric value via serde_json::to_value(item.kind) (SymbolKind inner field is private)
  • Adds regression test: SymbolKind::FUNCTION must serialize to 12u32

Closes #112

Test plan

  • cargo nextest run --workspace --all-features --lib --bins — 345 tests pass
  • cargo clippy --all-targets --all-features --workspace -- -D warnings — clean
  • cargo +nightly fmt --check — clean
  • New test test_convert_call_hierarchy_item_kind_is_numeric verifies the round-trip invariant

Changed kind field from String to u32 in CallHierarchyItemResult.
format!("{:?}", item.kind) produced debug strings like "Function" which
caused serde deserialization to fail in get_incoming_calls and
get_outgoing_calls (expected i32, got string). Now uses
serde_json::to_value to extract the numeric LSP value.

Adds regression test verifying SymbolKind::FUNCTION maps to 12u32.

Closes #112
@github-actions github-actions Bot added rust Rust code changes mcpls-core mcpls-core crate changes labels Apr 29, 2026
@bug-ops
bug-ops enabled auto-merge (squash) April 29, 2026 13:54
@bug-ops
bug-ops merged commit c327fbf into main Apr 29, 2026
16 checks passed
@bug-ops
bug-ops deleted the 112-call-hierarchy-kind-field branch April 29, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mcpls-core mcpls-core crate changes rust Rust code changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

call hierarchy: get_incoming_calls and get_outgoing_calls always fail — kind field serialized as string but deserialized as i32

1 participant