Commit Graph

20019 Commits

Author SHA1 Message Date
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
bors[bot]
8720281f15
Merge #10696
10696: internal: Replace more Name::to_string usages with Name::to_smol_str r=Veykril a=Veykril

Gets rid of some more unnecessary string allocs
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-11-04 17:13:33 +00: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
Chayim Refael Friedman
36bdb5c94d Type-check TS on CI and also turn off the strict setting useUnknownInCatchVariables
We don't follow it and I found that turning it on will have little benefit.
2021-11-04 01:23:45 +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
bors[bot]
71f5dae4b6
Merge #10683
10683: minor: Use `.into_iter()` method on array to avoid dereference r=lnicola a=arzg

Arguably it’s nicer to just use `.into_iter()` instead of iterating over references which are immediately dereferenced.

I also changed the use of `String::from` to `.to_string()` because the latter has around twenty times more usages in rust-analyzer.

Co-authored-by: Aramis Razzaghipour <aramisnoah@gmail.com>
2021-11-03 07:40:23 +00:00
Aramis Razzaghipour
16d38ec8b8
Use .into_iter() method on array to avoid dereference 2021-11-03 16:13:47 +11:00
Anatol Ulrich
9bce4d6696 accept identical Indels when merging; add rename test case 2021-11-02 21:38:38 +01:00
bors[bot]
04f03a360a
Merge #10672
10672: feat: upgrade ubuntu builders r=matklad a=matklad

For `-gnu` triples, use 20.04, the current LTS. This upgrades the
required version of glibc. For musl, just use `latest` as, presumably,
we don't care about glibc version in that case.

Hopefully, this unbreaks nightly publishing!

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-10-31 10:16:59 +00:00
Aleksey Kladov
045be6545f minor: group -gnu builders together 2021-10-31 13:16:36 +03:00
Aleksey Kladov
a4b40e60cb feat: upgrade ubuntu builders
For `-gnu` triples, use 20.04, the current LTS. This upgrades the
required version of glibc. For musl, just use `latest` as, presumably,
we don't care about glibc version in that case.
2021-10-31 13:16:36 +03:00
bors[bot]
eb32b60dc7
Merge #10671
10671: minor: Run apt-get update for AArch64 builds r=lnicola a=lnicola



Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-10-31 08:50:24 +00:00
Laurențiu Nicola
d6c162e40f Run apt-get update for AArch64 builds 2021-10-31 10:49:43 +02: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
bors[bot]
3ad83cc08d
Merge #10663
10663: minor: Bump `object` avoid a duplicate dependency r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-10-30 06:03:26 +00: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
Laurențiu Nicola
79d3f61590 Bump some deps 2021-10-29 23:26:58 +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
Lukas Wirth
98cff6572d Don't discard attributed items when a proc-macro unexpectedly fails to expand 2021-10-29 15:10:44 +02:00
bors[bot]
78108235d5
Merge #10657
10657: feat: Make unqualified derive attributes flyimportable r=Veykril a=Veykril

![UuwpKODbpB](https://user-images.githubusercontent.com/3757771/139436613-1e6eb8fd-f591-4fca-9383-ff7408ee9b18.gif)
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10052

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-10-29 13:01:49 +00:00
Lukas Wirth
ebd63ec1cf feat: Make unqualified derive attributes flyimportable 2021-10-29 14:51:26 +02:00
bors[bot]
057558b756
Merge #10595
10595: internal: Fix a format error r=Veykril a=dzvon

Fixes #10581

Co-authored-by: Dezhi Wu <wu543065657@163.com>
2021-10-29 10:40:43 +00:00
Dezhi Wu
74396d27c0 Fix: correct markdown link form. 2021-10-29 18:25:32 +08:00
Dezhi Wu
097d527cbd Fix: use a concise way to change link form when generating package.json 2021-10-29 10:00:10 +08:00
bors[bot]
b025bd6e7d
Merge #10656
10656: fix: Enable auto-import and qualify-path in derive attributes r=Veykril a=Veykril

cc https://github.com/rust-analyzer/rust-analyzer/issues/10052

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-10-28 16:49:55 +00:00
Lukas Wirth
7fdbdc4ab2 Enable auto-import and qualify-path in derive attributes 2021-10-28 18:40:38 +02:00