Description
test_hover_on_u64_type consistently fails in isolation because the column position (17) is past the end of the target line, causing rust-analyzer to return null hover.
Reproduction Steps
cargo nextest run --workspace --all-features --test integration_tests -E 'test(test_hover_on_u64_type)' -- --ignored
- Observe:
Hover should contain u64 type information, got: {"contents":"No hover information available","range":null}
Expected Behavior
Hover on u64 in pub id: u64, returns type information.
Actual Behavior
RA receives LSP position {"character":16,"line":18} (0-based). Line 18 is pub id: u64,; character 16 is after the trailing comma (line length is 16 characters, indices 0-15). RA returns null; mcpls maps null to "No hover information available".
Root Cause
The test passes MCP column 17 (→ LSP character 16). u64 spans characters 12–14 (0-based). The correct MCP column is 13–15. The off-by-four error stems from the fixture having 4-space indentation that was not accounted for when the column was chosen.
Fix
Change column 17 to 13 (start of u64) in rust_analyzer_tests.rs:
19,
13, // Position on "u64" — 1-based: 4 spaces + "pub id: " = 12 chars, 'u' is col 13
Environment
- Version: 0f40608
- Features: all-features
Logs / Evidence
LSP request sent: {"id":2,"method":"textDocument/hover","params":{"position":{"character":16,"line":18},...}}
Response: {"contents":"No hover information available","range":null}
Description
test_hover_on_u64_typeconsistently fails in isolation because the column position (17) is past the end of the target line, causing rust-analyzer to return null hover.Reproduction Steps
cargo nextest run --workspace --all-features --test integration_tests -E 'test(test_hover_on_u64_type)' -- --ignoredHover should contain u64 type information, got: {"contents":"No hover information available","range":null}Expected Behavior
Hover on
u64inpub id: u64,returns type information.Actual Behavior
RA receives LSP position
{"character":16,"line":18}(0-based). Line 18 ispub id: u64,; character 16 is after the trailing comma (line length is 16 characters, indices 0-15). RA returns null; mcpls maps null to "No hover information available".Root Cause
The test passes MCP column 17 (→ LSP character 16).
u64spans characters 12–14 (0-based). The correct MCP column is 13–15. The off-by-four error stems from the fixture having 4-space indentation that was not accounted for when the column was chosen.Fix
Change column
17to13(start ofu64) inrust_analyzer_tests.rs:Environment
Logs / Evidence
LSP request sent:
{"id":2,"method":"textDocument/hover","params":{"position":{"character":16,"line":18},...}}Response:
{"contents":"No hover information available","range":null}