rust-analyzer/crates/rust-analyzer
Johannes Altmanninger 94a4c3abaa Clamp Position::character to line length
LSP says about Position::character

> If the character value is greater than the line length it defaults back to the line length.

but from_proto::offset() doesn't implement this.

A client might for example request code actions for a whole line by sending
Position::character=99999.  I don't think there is ever a reason (besides laziness) why the
client can't specify the line length instead but I guess we should not crash but follow protocol.

Technically it should be a warning, not an error but warning is not shown by default so keep
it at error I guess.

Fixes #18240
2024-10-18 15:07:13 +02:00
..
src Clamp Position::character to line length 2024-10-18 15:07:13 +02:00
tests/slow-tests internal: add JSON formatting for hprof 2024-10-04 11:26:15 -04:00
build.rs Bump Cargo.lock 2024-05-14 10:57:02 +02:00
Cargo.toml Bump version of scip crate 2024-10-17 13:19:48 +08:00