Aramis Razzaghipour
f29796da61
Replace if let Some(_) = foo
with if foo.is_some()
2021-10-05 09:00:18 +11:00
Aramis Razzaghipour
eff195852d
Fix miscellaneous Clippy lints
2021-10-03 23:53:30 +11:00
Aramis Razzaghipour
55c0b86cde
Add semicolons for consistency
...
`clippy::semicolon_if_nothing_returned`
2021-10-03 23:39:43 +11:00
bors[bot]
ebe6c38a44
Merge #10438
...
10438: minor: Simplify r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-10-03 11:06:06 +00:00
Lukas Wirth
0943c4be8b
minor: Simplify
2021-10-03 13:05:42 +02:00
vi_mi
61643513b6
fix: await insertion with try_expr during extract_function
2021-10-03 09:41:21 +00:00
Aleksey Kladov
7dbf24fc7a
minor: dead code
2021-10-02 15:42:10 +03:00
Aleksey Kladov
d5c5b7cd12
internal: remove deprecated method
2021-10-02 15:28:55 +03:00
Aleksey Kladov
f04f8ddb0d
minor: regen
2021-10-02 15:20:16 +03:00
Aleksey Kladov
f3a1ff786f
minor: generated code readability
2021-10-02 15:20:03 +03:00
zhoufan
0ee6b70b34
Parse outer attributes on StructPatternEtCetera
2021-10-02 09:57:44 +08:00
Lukas Wirth
774a8cf08b
Fix inline_call breaking RecordExprField shorthands
2021-09-28 19:22:32 +02:00
Lukas Wirth
b6ed91a6de
Rename *Owner
traits to Has*
2021-09-27 12:54:24 +02:00
Lukas Wirth
a28c5d7311
Rename Dyn*
nodes to Any*
nodes
2021-09-27 12:45:36 +02:00
Aleksey Kladov
2bf81922f7
internal: more reasonable grammar for blocks
...
Consider these expples
{ 92 }
async { 92 }
'a: { 92 }
#[a] { 92 }
Previously the tree for them were
BLOCK_EXPR
{ ... }
EFFECT_EXPR
async
BLOCK_EXPR
{ ... }
EFFECT_EXPR
'a:
BLOCK_EXPR
{ ... }
BLOCK_EXPR
#[a]
{ ... }
As you see, it gets progressively worse :) The last two items are
especially odd. The last one even violates the balanced curleys
invariant we have (#10357 ) The new approach is to say that the stuff in
`{}` is stmt_list, and the block is stmt_list + optional modifiers
BLOCK_EXPR
STMT_LIST
{ ... }
BLOCK_EXPR
async
STMT_LIST
{ ... }
BLOCK_EXPR
'a:
STMT_LIST
{ ... }
BLOCK_EXPR
#[a]
STMT_LIST
{ ... }
2021-09-26 19:16:09 +03:00
bors[bot]
c51a3c78cf
Merge #10358
...
10358: internal: Remove inherent methods from ast nodes that do non-syntactic complex tasks r=Veykril a=Veykril
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-26 14:49:25 +00:00
Lukas Wirth
151afdfe5c
Remove inherent methods from ast node that carry semantic meaning
2021-09-26 16:49:03 +02:00
Aleksey Kladov
defe805fb7
internal: fix and force-disable block validation ;-(
...
Originally we tried to maintain the invariant that `{}` always match.
That is, that in the parse tree the pair of corresponding `{}` is always
first and last tokens of some nodes.
We had the code to validate that, but apparently it's been broken for
**years** since we introduced tokens/nodes split. Fixing it now makes
some tests fail.
It's unclear if we want to keep this invariant: there's a strong
motivation for breaking it in the following case:
```
use std::{ // unclosed paren
fn main() {
}
} // don't actually want to pair up this with the one from `use`
```
So let's fix the code, but disable it for the time being
2021-09-26 15:49:23 +03:00
bors[bot]
0cb9ee2054
Merge #10346
...
10346: minor: align code with code-style r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-09-25 11:56:23 +00:00
Aleksey Kladov
5767f31cbf
minor: align code with code-style
2021-09-25 14:55:42 +03:00
Aleksey Kladov
929fca5adc
minore: improve consistency
2021-09-25 14:36:46 +03:00
Lukas Wirth
42eb4efb5b
Cleanup
2021-09-23 16:28:03 +02:00
Lukas Wirth
83e97adfff
Simplify
2021-09-21 16:15:30 +02:00
Lukas Wirth
b36f12dba5
Simplify
2021-09-21 16:05:21 +02:00
Lukas Wirth
6d6e0b8f21
Generate ast nodes for each ast trait
2021-09-21 15:52:11 +02:00
bors[bot]
b7bedf16a1
Merge #10289
...
10289: fix: Only strip derive attributes when preparing macro input r=Veykril a=Veykril
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10246
cc https://github.com/rust-analyzer/rowan/pull/114 , follow up to https://github.com/rust-analyzer/rust-analyzer/pull/10025
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-19 21:46:51 +00:00
Lukas Wirth
a6dde501df
Only strip derive attributes when preparing macro input
2021-09-19 23:38:38 +02:00
Lukas Wirth
9c39363ada
Simplify
2021-09-19 23:34:07 +02:00
Lukas Wirth
3987bf5d6f
Simplify
2021-09-19 19:00:06 +02:00
bors[bot]
d44779f8a5
Merge #10260
...
10260: fix: fix names generation in `Generate function` r=Veykril a=iDawer
- Improve fn name computation (close #10176 ).
- Handle tuple indexing expressions in argument position (should close #10241 )
Co-authored-by: Dawer <7803845+iDawer@users.noreply.github.com>
2021-09-17 18:35:36 +00:00
Andrzej Głuszak
11a56f886b
assists: turn while into loop
2021-09-16 22:20:27 +02:00
Dawer
4dc33140a3
Imrove fn name computation in Generate function
2021-09-16 21:03:37 +05:00
Aleksey Kladov
682fbbbd5a
minor: modernize
2021-09-06 18:54:16 +03:00
Aleksey Kladov
104cd0ce88
internal: make name consistent with usage
2021-09-06 18:34:03 +03:00
Dawer
a6c650edf6
fix: use placeholder as default type in Generate function
.
2021-09-04 14:24:54 +05:00
Daiki Ihara
4d005e529b
Fix extract_function with macro arg
2021-09-01 11:11:57 +02:00
Aleksey Kladov
d1cd81f387
internal: more declarative re-indentation API
2021-08-24 18:18:43 +03:00
bors[bot]
6287d388c0
Merge #9944
...
9944: internal: introduce in-place indenting API r=matklad a=iDawer
Introduce `edit_in_place::Indent` that uses mutable tree API and intended to replace `edit::AstNodeEdit`.
Closes #9903
Co-authored-by: Dawer <7803845+iDawer@users.noreply.github.com>
2021-08-24 13:11:50 +00:00
Aleksey Kladov
0a7e57177e
internal: use single env var to controll all benchmarks
2021-08-23 16:40:42 +03:00
Dawer
08694dc1ef
minor: address review comments
2021-08-18 19:04:10 +05:00
Dawer
d6c4165182
internal: introduce in-place indenting API
2021-08-18 16:05:23 +05:00
Aleksey Kladov
3c49a9f079
minor: move functionality to a better place
2021-08-14 20:43:28 +03:00
Aleksey Kladov
78c7940f5c
internal: remove dead code
2021-08-14 20:29:46 +03:00
Aleksey Kladov
e300f58d2c
internal: remove one more usage of old editing API.
2021-08-14 20:17:16 +03:00
Aleksey Kladov
dc17b35e62
internal: remove a remnant of old editing infra
2021-08-14 18:24:42 +03:00
Aleksey Kladov
90357a9090
internal: merge hir::BinaryOp and ast::BinOp
2021-08-14 18:10:01 +03:00
Aleksey Kladov
fe4f059450
internal: prepare to merge hir::BinaryOp and ast::BinOp
2021-08-14 17:07:51 +03:00
Aleksey Kladov
6df00f8495
internal: make naming consistent
2021-08-14 17:01:28 +03:00
Aleksey Kladov
faa420fc32
internal: prepare a dedicated module for all operators
2021-08-14 16:58:46 +03:00
Jonas Schievink
d568e7686a
Support if let
match guards
2021-08-13 00:25:14 +02:00