Skip to content

test: test_hover_on_u64_type uses wrong column position — always returns no hover #138

@bug-ops

Description

@bug-ops

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

  1. cargo nextest run --workspace --all-features --test integration_tests -E 'test(test_hover_on_u64_type)' -- --ignored
  2. 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}

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium: suboptimal behavior, minor inconsistencybugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions