rust/crates/rust-analyzer/src
bors[bot] 0808ade4e4
Merge #11182
11182: fix: don't panic on seeing an unexpected offset r=Veykril a=dimbleby

Intended as a fix, or at least a sticking plaster, for #11081.

I have arranged that [offset()](1ba9a924d7/crates/ide_db/src/line_index.rs (L105-L107)) returns `Option<TextSize>` instead of going out of bounds; other changes are the result of following the compiler after doing this.

Perhaps there's still an issue here - I suppose the server and client have gotten out of sync and that probably shouldn't happen in the first place?  I see that https://github.com/rust-analyzer/rust-analyzer/issues/10138#issuecomment-913727554 suggests what sounds like a more substantial fix which I think might be aimed in this direction.  So perhaps that one should be left open to cover such things?

Meanwhile, I hope that not-crashing is a good improvement: and I can confirm that it works out just fine in the repro I have at #11081.

Co-authored-by: David Hotham <david.hotham@metaswitch.com>
2022-01-31 11:16:22 +00:00
..
bin feat: poke user when supplying faulty configurations 2022-01-06 14:24:19 +01:00
cli cleanup + detect num cpus 2022-01-14 09:48:59 +00:00
diagnostics Merge #10902 2021-12-05 10:52:54 +00:00
caps.rs Pull in new lsp-types for VS compat 2021-10-18 12:03:49 +03:00
cargo_target_spec.rs internal: remove useless helpers 2021-08-09 15:58:21 +03:00
cli.rs Begining of lsif 2021-09-26 10:04:02 +03:30
config.rs make it a config 2022-01-15 02:47:47 +00:00
diagnostics.rs Handle multiple cargo check quick fix spans 2021-12-04 21:41:56 -08:00
diff.rs Split textDocument/formatting TextEdit with diff 2020-12-31 15:33:20 +01:00
dispatch.rs Merge #10080 2021-08-30 07:58:59 +00:00
from_proto.rs fix: don't panic on seeing an unexpected offset 2022-01-03 14:49:47 +00:00
global_state.rs Set server status to warning when proc-macro sources change 2021-10-30 14:49:32 +02:00
handlers.rs fix: don't panic on seeing an unexpected offset 2022-01-03 14:49:47 +00:00
integrated_benchmarks.rs Migrate to edition 2021 2021-10-21 20:10:40 +02:00
lib.rs internal: optimize compile time 2021-08-15 13:24:37 +03:00
line_index.rs use utf16 instead of utf8 2021-09-26 10:04:02 +03:30
lsp_ext.rs internal: add "Shuffle Crate Graph" command 2021-12-07 16:37:19 +01:00
lsp_utils.rs fix: don't panic on seeing an unexpected offset 2022-01-03 14:49:47 +00:00
main_loop.rs Merge #11281 2022-01-25 16:03:35 +00:00
markdown.rs perf: avoid allocating by just slicing. 2021-10-26 20:59:48 +08:00
mem_docs.rs fix: correctly update diagnostics when files are opened and closed 2021-07-26 21:22:06 +03:00
op_queue.rs internal: simplify handling of the build scripts 2021-07-18 11:29:22 +03:00
reload.rs Regenrate docs and package.json 2022-01-06 13:50:24 +01:00
semantic_tokens.rs internal: Handle macro calls better in highlighting 2022-01-02 19:10:10 +01:00
thread_pool.rs Improve prime_caches and display its progress 2020-10-12 13:35:01 +02:00
to_proto.rs internal: Handle macro calls better in highlighting 2022-01-02 19:10:10 +01:00