rust/crates
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
..
base_db feat: Honor recursion limit configuration 2022-01-28 11:31:59 +03:00
cfg
flycheck
hir Complete local fn and closure params from surrounding locals scope 2022-01-31 11:56:42 +01:00
hir_def Fix cfg_attr invalidating derive identifier IDE functionality 2022-01-30 22:47:16 +01:00
hir_expand Reduce allocations in attribute collection 2022-01-30 22:18:32 +01:00
hir_ty Bump chalk 2022-01-21 19:51:21 +02:00
ide Fix cfg_attr invalidating derive identifier IDE functionality 2022-01-30 22:47:16 +01:00
ide_assists format 2022-01-14 22:13:45 +00:00
ide_completion Complete local fn and closure params from surrounding locals scope 2022-01-31 11:56:42 +01:00
ide_db Merge #11182 2022-01-31 11:16:22 +00:00
ide_diagnostics More correct $crate handling in eager macros 2022-01-27 16:57:53 +01:00
ide_ssr
limit Use compare_exchange_weak in limit::Limit::check 2022-01-28 18:19:35 +03:00
mbe Make syntax bridge fully infallible 2022-01-24 17:27:39 +01:00
parser Allow macros to expand to or-patterns 2022-01-17 16:52:53 +01:00
paths
proc_macro_api Set current working directory for procedural macros 2022-01-27 16:18:12 +03:00
proc_macro_srv Merge #11356 2022-01-30 08:05:55 +00:00
proc_macro_test
profile
project_model Update tests 2022-01-18 18:27:29 +01:00
rust-analyzer Merge #11182 2022-01-31 11:16:22 +00:00
sourcegen
stdx
syntax Reduce allocations in attribute collection 2022-01-30 22:18:32 +01:00
test_utils
text_edit
toolchain
tt
vfs
vfs-notify