Commit graph

19514 commits

Author SHA1 Message Date
Aleksey Kladov
3e8ef943c6 internal: move some tests 2021-10-09 18:18:56 +03:00
Aleksey Kladov
a060b9a4b2 internal: move some macro tests 2021-10-09 18:15:05 +03:00
Aleksey Kladov
c2e425dd00 internal: make sure macro test expand to valid syntax 2021-10-09 18:06:24 +03:00
Aleksey Kladov
c41b7bbe69 internal: allow macro tests to inspect parse tree 2021-10-09 17:58:17 +03:00
Aleksey Kladov
aac23f7832 move tests 2021-10-09 17:43:07 +03:00
Aleksey Kladov
6407e2e789 indent macro output when pprinting 2021-10-09 17:36:41 +03:00
Aleksey Kladov
a0d9e78ec3 align tests to code style 2021-10-09 17:31:24 +03:00
Aleksey Kladov
036c0ff8c7 move some tests 2021-10-09 17:27:38 +03:00
Aleksey Kladov
cb1b6a273f internal: don't un-indent macro tests manually 2021-10-09 17:17:37 +03:00
Aleksey Kladov
afacdd612d internal: update expect 2021-10-09 17:17:16 +03:00
Aleksey Kladov
959da8caa1 internal: move test 2021-10-09 16:31:26 +03:00
Aleksey Kladov
59c86ff300 rename 2021-10-09 16:28:11 +03:00
Aleksey Kladov
75b0ce17cf move test 2021-10-09 16:27:19 +03:00
Aleksey Kladov
0dd1b35479 move test 2021-10-09 16:25:37 +03:00
Aleksey Kladov
574df660e4 move test 2021-10-09 16:22:42 +03:00
Aleksey Kladov
b21244e080 internal: move test 2021-10-09 16:19:19 +03:00
bors[bot]
26f4124b26
Merge #10494
10494: Macro expansion tests r=matklad a=matklad

bors r+

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-10-09 12:30:27 +00:00
Aleksey Kladov
84d182c7a2 internal: docs 2021-10-09 15:29:31 +03:00
Aleksey Kladov
ef1251f696 feat: report errors in macro definition
Reporting macro *definition* error at the macro *call site* is a rather
questionable approach, but at least we don't erase the errors
altogether!
2021-10-09 15:23:55 +03:00
Aleksey Kladov
b3d1de93af get organizized 2021-10-09 14:53:15 +03:00
Aleksey Kladov
8e9003447c future proof structure 2021-10-09 14:48:38 +03:00
Aleksey Kladov
5ecda802f1 move test 2021-10-09 14:45:52 +03:00
Aleksey Kladov
f4ee0d736c move tests 2021-10-09 14:39:24 +03:00
Aleksey Kladov
1abe3f8275 internal: move tests 2021-10-09 14:22:49 +03:00
Aleksey Kladov
49f5fecf06 internal: move test 2021-10-09 14:18:53 +03:00
Aleksey Kladov
78ca43ef3d internal: move test 2021-10-09 13:51:02 +03:00
Aleksey Kladov
093f99b809 internal: start new macro test suite
I don't like our macro tests -- they are brittle and don't inspire
confidence. I think the reason for that is that we try to unit-test
them, but that is at odds with reality, where macro expansion
fundamentally depends on name resolution.
2021-10-09 13:42:32 +03:00
bors[bot]
545b068a77
Merge #10474
10474: feat: Support `let...else` r=jonas-schievink a=jonas-schievink

bors r+

closes https://github.com/rust-analyzer/rust-analyzer/issues/10469

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-10-07 15:09:42 +00:00
Jonas Schievink
f8acae7895 Support let...else 2021-10-07 17:06:24 +02:00
bors[bot]
4675410f07
Merge #10477 #10482
10477: parser: fix parsing of macro call inside generic args r=Veykril a=cynecx



10482: fix: fix `inline_call` trying to use an uncached syntax node in Semantics r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10475
bors r+

Co-authored-by: cynecx <me@cynecx.net>
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-10-07 13:05:18 +00:00
Lukas Wirth
12465a8a3c Expose HasSource::source through Semantics with caching behaviour 2021-10-07 15:00:14 +02:00
bors[bot]
5191fb755b
Merge #10480
10480: fix: Change `stdx::to_snake_case` to match rustc implementation r=Veykril a=Crauzer

Fixes #10473

Co-authored-by: crauzer <filip.quitko@gmail.com>
2021-10-07 12:56:28 +00:00
bors[bot]
fd3f4c50da
Merge #10467
10467: Optimize CodeLens for references/impls r=Veykril a=ericsampson

Don't do unnecessary work.
Followup to #10447 . cc `@Veykril` 

Co-authored-by: Eric Sampson <esampson@eaze.com>
2021-10-06 21:47:22 +00:00
Eric Sampson
efca421c43 Refactor to eliminate a vector allocation. 2021-10-06 16:43:37 -05:00
crauzer
ba62a8a075 fix test 2021-10-06 23:37:43 +02:00
crauzer
a4f08c117f Fix stdx::to_snake_case 2021-10-06 23:24:47 +02:00
bors[bot]
f30b62b751
Merge #10479
10479: fix: fix "index out of bounds" panic in name resolution r=jonas-schievink a=jonas-schievink

Closes https://github.com/rust-analyzer/rust-analyzer/issues/10084
Closes https://github.com/rust-analyzer/rust-analyzer/issues/9163

This is really just a salsa update to a version that removes the problematic code (see https://github.com/rust-analyzer/rust-analyzer/issues/10084#issuecomment-934445711)

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-10-06 20:54:27 +00:00
bors[bot]
12d33eafaf
Merge #10476
10476: feat: Add `replace_try_expr_with_match` assist r=Veykril a=Crauzer

Adds the replace_try_expr_with_match assist
#10424

Co-authored-by: crauzer <filip.quitko@gmail.com>
2021-10-06 20:45:14 +00:00
Jonas Schievink
cda9668289 Update salsa 2021-10-06 22:42:54 +02:00
cynecx
07cd19dcef parser: fix parsing of macro call inside generic args 2021-10-06 22:41:35 +02:00
bors[bot]
eb60836a39
Merge #10478
10478: minor: Update Cargo.lock r=Veykril a=Veykril

This causes CI to fail for some reason I think
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-10-06 20:36:15 +00:00
Lukas Wirth
fb27c58a04 Update Cargo.lock 2021-10-06 22:34:55 +02:00
crauzer
1161fa45af fix tests 2021-10-06 20:45:18 +02:00
crauzer
765d7f20f9 add sourcegen 2021-10-06 20:23:22 +02:00
crauzer
05e58afde2 Add replace_try_expr_with_match assist 2021-10-06 20:11:00 +02:00
bors[bot]
94fa49c0a3
Merge #10420
10420: Parse outer attributes on StructPatternEtCetera r=jonas-schievink a=XFFXFF

Try to fix https://github.com/rust-analyzer/rust-analyzer/issues/8610  
Related pr in ungrammer: https://github.com/rust-analyzer/ungrammar/pull/41

Co-authored-by: zhoufan <1247714429@qq.com>
2021-10-06 15:05:40 +00:00
bors[bot]
4cfe237a56
Merge #10459
10459: feat: Add generate constant assist r=Veykril a=longfangsong

Close #10330.
![demo(1)](https://user-images.githubusercontent.com/13777628/135885262-c80de86f-5555-4f84-9508-822243f8a876.gif)



Co-authored-by: longfangsong <longfangsong@icloud.com>
Co-authored-by: 龙方淞 <longfangsong@icloud.com>
2021-10-06 09:38:58 +00:00
Eric Sampson
0d77be67f7 Don't do work and then throw it away. 2021-10-06 01:16:31 -05:00
longfangsong
3fde682bcf cleanup 2021-10-06 10:14:12 +08:00
龙方淞
7228dbadca
Update crates/ide_assists/src/handlers/generate_constant.rs
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-10-06 10:06:51 +08:00