Aleksey Kladov
36ee9ecb67
Cleanup early return assist
2020-02-07 12:30:39 +01:00
Aleksey Kladov
aa1234e02b
Generalize invert_if to just always work
2020-02-07 12:14:33 +01:00
Aleksey Kladov
56e3fbe588
A tiny bit more consistent API
2020-02-06 23:59:27 +01:00
Aleksey Kladov
a4c6e8c4e2
Refactor if-let -> match assist to use ast::make
2020-02-05 14:08:16 +01:00
Aleksey Kladov
4ea0c12cf1
Make sure that newly created nodes are the root of the tree
2020-02-04 13:22:32 +01:00
Veetaha
fa31841f1f
Fixed a typo
2020-01-22 13:02:21 +02:00
Veetaha
1ac105056a
Fixed a typo
2020-01-22 13:02:21 +02:00
Veetaha
b6be1b6f61
Preserved a comment on the bug previously present in ast::Literal::kind()
2020-01-22 13:02:21 +02:00
Veetaha
3ec781d4f2
ra_syntax: remove code duplication and token reevaluation from ast::Literal::kind()
2020-01-22 13:02:21 +02:00
TomasKralCZ
72792f6bc5
changed 'descendants()' to 'children()'
2020-01-20 10:19:33 +01:00
TomasKralCZ
f67ee69777
added eq_token() method to LetStmt
2020-01-19 18:55:56 +01:00
Aleksey Kladov
ef1326ee19
More orthogonal path editing
2020-01-15 18:48:28 +01:00
Aleksey Kladov
7d2d3ac3db
More fluent API
2020-01-15 18:30:23 +01:00
Aleksey Kladov
c84010e246
Slightly more fluent API
2020-01-15 18:14:49 +01:00
Aleksey Kladov
8296d3208d
Simplify
2020-01-15 18:01:05 +01:00
Aleksey Kladov
448575aa4a
Simplify
2020-01-15 18:01:05 +01:00
kjeremy
a82c679c97
Some clippy lints
2020-01-13 11:27:06 -05:00
Florian Diebold
2c11a9b42d
Qualify paths in 'fill match arms' assist
2020-01-12 11:34:52 +01:00
Florian Diebold
15fc643e05
Fix ordering problem between qualifying paths and substituting params
2020-01-11 23:33:04 +01:00
Florian Diebold
4545f289a9
Handle type args
2020-01-11 23:33:04 +01:00
Jeremy Kolb
d993f329a0
Basic DocumentHighlightKind support for assignments
2020-01-10 15:14:19 -05:00
Michael Chesser
ce1b34fd59
Improve const generics parsing
...
- Handle const generics type args
- Fix issue with const generic as first parameter in trait impl
2020-01-07 09:29:03 +10:30
Jeremy Kolb
5afb22e2b3
BinOp helper to detect assignment
2020-01-04 15:54:31 -05:00
Aleksey Kladov
084bd304f3
Switch ast declaration from ron to a macro
2020-01-03 21:54:10 +01:00
Florian Diebold
79c90b5641
Collect visibility of items during nameres
2019-12-26 16:23:40 +01:00
Florian Diebold
069bf55cca
Add infrastructure for visibility on syntax and hir_def level
2019-12-26 16:23:40 +01:00
Edwin Cheng
208ad97fdc
Remove AsyncOwner
2019-12-25 00:25:18 +08:00
Edwin Cheng
0edb5b4a50
Implement infer await from async func
2019-12-24 19:45:28 +08:00
bors[bot]
d33493d779
Merge #2641
...
2641: Parse const generics r=matklad a=roblabla
Adds very primitive support for parsing const generics (`const IDENT: TY`) so that rust-analyzer stops complaining about the syntax being invalid.
Fixes #1574
Fixes #2281
Co-authored-by: roblabla <unfiltered@roblab.la>
2019-12-22 07:56:33 +00:00
roblabla
b04d4a88d1
Parse const generics
...
Fixes #1574
Fixes #2281
2019-12-22 01:32:08 +00:00
kjeremy
0d5d63a80e
Clippy lints
2019-12-20 15:14:30 -05:00
Florian Diebold
2a8c9100bf
Handle closure return types
...
Fixes #2547 .
2019-12-20 18:16:11 +01:00
kjeremy
f22aabc136
Use unwrap_or_default
2019-12-20 09:43:30 -05:00
ice1000
379482068d
Add ModuleItemsOwner
to Block
2019-12-03 12:07:39 -05:00
Aleksey Kladov
5fd68b5929
Fix hir for ast::UnionDef
2019-11-25 17:50:49 +03:00
Aleksey Kladov
e1c0bdaf75
Introduce dedicated AST node for union
...
Although structs and unions have the same syntax and differ only in
the keyword, re-using the single syntax node for both of them leads to
confusion in practice, and propagates further down the hir in an
upleasent way.
Moreover, static and consts also share syntax, but we use different
nodes for them.
2019-11-25 17:50:49 +03:00
bors[bot]
7b6aa7c34e
Merge #2343
...
2343: implement assist invert_if r=matklad a=bravomikekilo
fix [issue 2219 invert if condition](https://github.com/rust-analyzer/rust-analyzer/issues/2219 )
I put the assist cursor range to `if` of the if expression, because both condition and body will be replaced. Is there any way to replace them without cover the cursor position?
@matklad
Co-authored-by: bravomikekilo <bmk1221@126.com>
2019-11-24 08:32:07 +00:00
bravomikekilo
adac4fc2f2
do refact and fix some issue
2019-11-24 13:14:57 +08:00
Aleksey Kladov
d8caf56dfc
Uniformalize naming
2019-11-22 21:52:06 +03:00
Aleksey Kladov
0e771915fa
Allow non-path default type parameters
2019-11-20 11:46:44 +03:00
Aleksey Kladov
83a8430e0a
⬆️ rowan
2019-11-19 21:13:36 +03:00
DJMcNab
27ce1e822b
Remove the custom impl of AttrsOwner for ImplItem
...
The default impl should have the same behaviour, and it can be generated
by codegen.
See also `ModuleItem` and `NominalDef`
2019-11-18 18:13:56 +00:00
Aleksey Kladov
5b54a93fe7
Add ast for plain and raw string literals
2019-11-16 22:50:41 +03:00
Geoffry Song
5645c153e0
Attempt to implement typed accessors
2019-11-15 12:05:29 -08:00
Aleksey Kladov
4cea6bb6f1
Make make:: builders slightly more convenient
2019-11-13 11:59:18 +03:00
Aleksey Kladov
e177c65e36
Use strongly-typed ast building for early-return assist
2019-11-13 11:54:21 +03:00
bors[bot]
fe6ba12a77
Merge #2149
...
2149: Handle IfLet in convert_to_guarded_return. r=matklad a=krk
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/2124
I could not move the cursor position out of `let`:
`le<|>t` vs `let<|>`.
Also, please suggest extra test cases.
Co-authored-by: krk <keremkat@gmail.com>
2019-11-04 09:06:53 +00:00
krk
91ab3f8760
Support paths other than "Some".
2019-11-01 18:18:58 +01:00
krk
4a4d9f7a90
Handle IfLet in convert_to_guarded_return.
2019-10-31 21:10:58 +01:00
kjeremy
78f93c8033
traits => match_ast!
2019-10-30 16:08:59 -04:00