bors[bot]
f724c84e7d
Merge #10738
...
10738: internal: Do not search through all three namespaces in `ItemScope::name_of` r=Veykril a=Veykril
Brings down `5ms - find_path_prefixed (46 calls)` to `1ms - find_path_prefixed (46 calls)` for me on the `integrated_completion_benchmark`.
Still `O(n)` but this should considerably cut down lookups nevertheless(as shown by the timings already).
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-11-10 15:12:05 +00:00
Lukas Wirth
3c8898b1b1
Do not search through all three namespaces in ItemScope::name_of
2021-11-10 16:08:40 +01:00
bors[bot]
899610778b
Merge #10731
...
10731: fix: show the right check-command r=Veykril a=Florian-Schoenherr
Currenty r.a. only shows this:
![image](https://user-images.githubusercontent.com/65456722/140977478-e6bc8a45-7c25-4578-9406-fb34f1eb0792.png )
even if another command was specified
There might be a better way to do this, I tried.
Co-authored-by: Florian-Schoenherr <florian.schoenherr99@gmail.com>
2021-11-09 22:11:32 +00:00
Florian-Schoenherr
4fb76743ca
fix: show the right check-command
...
Signed-off-by: Florian-Schoenherr <florian.schoenherr99@gmail.com>
2021-11-09 21:52:55 +01:00
Laurențiu Nicola
e98b072da7
Bump chalk
2021-11-09 20:05:04 +02:00
bors[bot]
3c786bd7fd
Merge #10726
...
10726: minor: Add some completion profile spans r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-11-08 18:42:10 +00:00
Lukas Wirth
ab657af5b7
Add some completion profile spans
2021-11-08 19:41:16 +01:00
Lukas Wirth
26419c0379
Fix proc-macro attributes being shadowed by their functions in IDE layer
2021-11-08 14:49:50 +01:00
bors[bot]
c5c11b87cc
Merge #10720
...
10720: fix: Don't ascribe types in pattern completion for param patterns twice r=Veykril a=Veykril
Fixes #10323
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-11-08 13:12:03 +00:00
Lukas Wirth
f7e8136923
Add test for current incorrect behaviour
2021-11-08 14:10:26 +01:00
bors[bot]
2c0f433fd2
Merge #10699
...
10699: internal: Make CompletionItem `label` and `lookup` fields `SmolStr`s r=Veykril a=Veykril
This replaces a bunch of String clones with SmolStr clones, though also makes a few parts a bit more expensive(mainly things involving `format!`ted strings as labels).
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-11-07 11:13:15 +00:00
bors[bot]
e4ce6c7468
Merge #10698
...
10698: implement multi-token mapping for ssr r=Veykril a=spookyvision
Co-authored-by: Anatol Ulrich <anatol.ulrich@ferrous-systems.com>
2021-11-07 11:02:39 +00:00
Laurențiu Nicola
d18a379c7b
Bump deps
2021-11-06 17:40:38 +02:00
Lukas Wirth
7369360c15
Don't ascribe types in pattern completion for patterns twice
2021-11-05 18:39:36 +01:00
bors[bot]
726b4dd8bd
Merge #10704
...
10704: internal: Short-circuit `descend_into_macros_single` r=Veykril a=Veykril
There is no need to descend everything if all we are interested in is the first mapping.
This bring `descend_into_macros` timing in highlighting in `rust-analyzer/src/config.rs` from `154ms - descend_into_macros (2190 calls)` to `24ms - descend_into_macros (2190 calls)` since we use the single variant there(will regress once we want to highlight multiple namespaces again though).
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-11-05 15:06:37 +00:00
Lukas Wirth
4d768bede0
Short-circuit descend_into_macros_single
2021-11-05 16:03:45 +01:00
Lukas Wirth
addd93ed9a
Don't search for root nodes unnecessarily
2021-11-05 15:52:10 +01:00
bors[bot]
274d9f90ae
Merge #10703
...
10703: internal: Don't check items for macro calls if they have no attributes r=Veykril a=Veykril
Turns out when highlighting we currently populate the Dynmaps of pretty much every item in a file, who would've known that would be so costly...
Shaves off 250 ms for the integrated benchmark on `rust-analyzer/src/config.rs`.
We are still looking at a heft `154ms - descend_into_macros (2190 calls)` but I feel like this is slowly nearing towards just call overhead.
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-11-05 13:53:59 +00:00
Lukas Wirth
8dad1b9228
Don't check items for macro calls if they have no attributes
2021-11-05 14:50:10 +01:00
bors[bot]
d1e449e313
Merge #10701
...
10701: internal: Cache ast::MacroCalls to their expansions in Semantics::descend_into_macros_impl r=Veykril a=Veykril
Saves ~45ms when highlighting `rust-analyzer/src/config.rs` for me
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-11-05 13:26:56 +00:00
Lukas Wirth
af4d244462
Cache ast::MacroCalls to their expansions in Semantics::descend_into_macros_impl
2021-11-05 14:25:47 +01:00
Lukas Wirth
2f5afba9f8
Replace some String usages with SmolStr in completions
2021-11-05 12:30:39 +01:00
bors[bot]
10782bbb39
Merge #10685
...
10685: fix: Enable markdown tables r=Veykril a=Veykril
Should fix https://github.com/rust-analyzer/rust-analyzer/issues/10655
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-11-05 11:25:17 +00:00
Anatol Ulrich
69e666fdba
maybe?
2021-11-04 22:01:59 +01:00
Lukas Wirth
439a8194b0
Replace more Name::to_string usages with Name::to_smol_str
2021-11-04 18:12:05 +01:00
Lukas Wirth
4d4574f5b6
Enable markdown tables
2021-11-04 17:36:58 +01:00
bors[bot]
962be38004
Merge #10645
...
10645: fix: make `rename` multi-token mapping aware r=Veykril a=spookyvision
Co-authored-by: Anatol Ulrich <anatol.ulrich@ferrous-systems.com>
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Co-authored-by: Anatol Ulrich <45840+spookyvision@users.noreply.github.com>
2021-11-04 16:31:16 +00:00
bors[bot]
c96481e25f
Merge #10691
...
10691: minor: Use array `into_iter` in more places r=lnicola a=lnicola
bors r+
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-11-04 05:52:05 +00:00
Laurențiu Nicola
139bf9b4e1
Use array into_iter in more places
2021-11-04 07:51:20 +02:00
bors[bot]
a8247685cf
Merge #10686
...
10686: internal: Add `Semantics::original_ast_node` for upmapping nodes out of macro files r=Veykril a=Veykril
Fixes trying to insert imports into macro expanded files which then do text edits on very wrong text ranges.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-11-03 20:23:14 +00:00
Lukas Wirth
96db0d8bdd
Add Semantics::original_ast_node for upmapping nodes out of macro files
2021-11-03 21:12:36 +01:00
bors[bot]
9ee855bcc5
Merge #10680
...
10680: implement Literal::from_str r=jonas-schievink a=spookyvision
this apparently fixes RTIC 0.6's
```rust
#[rtic::app]
mod app {}
```
Co-authored-by: Anatol Ulrich <anatol.ulrich@ferrous-systems.com>
2021-11-03 16:19:42 +00:00
Anatol Ulrich
a6df2b16df
implement Literal::from_str
2021-11-03 16:50:43 +01:00
bors[bot]
0bd2d234a2
Merge #10667
...
10667: internal: Expose version string of crates from HIR r=Veykril a=Veykril
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10664
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-11-03 14:50:39 +00:00
Anatol Ulrich
e8416bb644
Update crates/text_edit/src/lib.rs
...
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-11-03 15:44:46 +01:00
Anatol Ulrich
83927e08a8
Update crates/ide/src/rename.rs
...
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-11-03 15:44:32 +01:00
Lukas Wirth
52f5af7165
Expose version string of crates fom HIR
2021-11-03 15:40:06 +01:00
bors[bot]
53b5b2fdaa
Merge #10596
...
10596: internal: Set server status to warning when proc-macro sources change r=Veykril a=Veykril
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10027
![image](https://user-images.githubusercontent.com/3757771/138102552-208d3edf-a843-49e6-9f48-1e911f54a4ba.png )
It feels wrong using the database in this part of the code, but this was the only way to figure out whether a file belongs to a proc-macro that I could think of.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-11-03 14:02:10 +00:00
Lukas Wirth
9025f51118
Add disjoint check back in TextEdit::union
2021-11-03 14:42:15 +01:00
Anatol Ulrich
7581ba3f30
forgot a dbg
2021-11-03 14:21:29 +01:00
Anatol Ulrich
9bce4d6696
accept identical Indels when merging; add rename test case
2021-11-02 21:38:38 +01:00
bors[bot]
7765c1a94f
Merge #10668
...
10668: fix: Fix for-loop expressions breaking with BlockExpr iterable r=Veykril a=Veykril
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10665
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-10-30 14:42:53 +00:00
Lukas Wirth
c93983e76f
Fix for-loop expressions breaking with BlockExpr iterable
2021-10-30 16:37:32 +02:00
Lukas Wirth
1d80302b76
Set server status to warning when proc-macro sources change
2021-10-30 14:49:32 +02:00
Laurențiu Nicola
80f9afa1ec
Bump object avoid a duplicate dependency
2021-10-30 09:02:45 +03:00
bors[bot]
103bef178c
Merge #10650
...
10650: minor: Bump deps r=lnicola a=lnicola
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-10-29 20:27:51 +00:00
Laurențiu Nicola
d0a99ad54e
Bump chalk
2021-10-29 23:26:59 +03:00
bors[bot]
8c078147b5
Merge #10662
...
10662: Fix Plaintext textDocument/hover r=Veykril a=vsrs
Relates to #10028
Note: the PR corrects only invalid content kind, not formatting.
Co-authored-by: vsrs <vit@conrlab.com>
2021-10-29 16:16:13 +00:00
vsrs
2f862cd6fe
Fix Plaintext textDocument/hover
2021-10-29 18:23:47 +03:00
bors[bot]
b9fa37f5b4
Merge #10648
...
10648: fix: Don't discard attributed items when a proc-macro unexpectedly fails to expand r=Veykril a=Veykril
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/9205
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-10-29 13:13:12 +00:00