Laurențiu Nicola
fb9529626d
Spelling nits
2021-12-17 17:26:35 +02:00
Lukas Wirth
9fe0f0d1d9
Add a few default snippets for VSCode
2021-12-17 16:24:29 +01:00
Lukas Wirth
d3e538638a
fix: Don't duplicate attribute completions
2021-12-17 15:22:53 +01:00
k-nasa
0e9095e42c
manual run sourcegen_lint_completions
2021-12-17 08:46:17 +09:00
k-nasa
7643e08962
Add clippy lint group to attribute auto compleme
2021-12-17 08:34:08 +09:00
k-nasa
4e6e65dd71
List struct to clonable
2021-12-17 08:33:46 +09:00
Wang Ruochen
ee079561b1
Add comma for "move if to guard"
2021-12-15 15:26:24 -08:00
bors[bot]
4ec6bd6206
Merge #11017
...
11017: Support "move if to guard" with an else branch r=Veykril a=weirane
Support the assist `move_arm_cond_to_match_guard` when there is an else branch.
I have two questions:
1. How to indent the first line of a match arm? `matcharm.indent()` doesn't seem to work. so I hard coded four spaces here:
95a0de85d5/crates/ide_assists/src/handlers/move_guard.rs (L162-L163)
2. I find a little issue in the original implementation, this code
```rust
let y = match 92 {
x => {
if x == 0 {$0
false
}
}
_ => true,
};
```
will be transformed to
```rust
let y = match 92 {
x if x == 0 => false
_ => true,
};
```
a comma is missing after the `false`. Should I also fix that? Or this can go in a separate PR.
Closes #10997 .
Co-authored-by: Wang Ruochen <wrc@ruo-chen.wang>
2021-12-15 23:04:51 +00:00
Wang Ruochen
e8d0742997
Add coverage marks
2021-12-15 14:44:47 -08:00
iDawer
676744be6e
Bump MSRV (1.57)
2021-12-16 01:56:12 +05:00
Wang Ruochen
95a0de85d5
Support "move if to guard" with an else branch
2021-12-14 10:27:44 -08:00
bors[bot]
9efa355a62
Merge #11011
...
11011: minor: Simplify r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-12-14 11:56:30 +00:00
Lukas Wirth
901c7c7277
match_ast!
takes a pattern to allow underscore usage
2021-12-14 12:44:31 +01:00
Lukas Wirth
9915103c9e
Simplify
2021-12-14 12:38:20 +01:00
Lukas Wirth
04a7fbbddb
Move out doc-links tests into a separate module
2021-12-14 12:10:43 +01:00
zhoufan
c3ad945d9b
fixes broken tests
2021-12-14 15:57:58 +08:00
zhoufan
7b952cb1aa
infer associated method in local scope
2021-12-14 15:34:57 +08:00
bors[bot]
791722b70a
Merge #10998
...
10998: Add number representation assists r=Veykril a=errx
Reimplemented assists from this PR https://github.com/rust-analyzer/rust-analyzer/pull/3683 with current APIs.


I've decided not to add options about size of the groups so behaviour is similar to clippy's.
Minimal number length is also taken from clippy.
Co-authored-by: Oleg Matrokhin <matrokhin@gmail.com>
2021-12-13 18:49:06 +00:00
Oleg Matrokhin
60605a24d4
Reuse results from split_into_parts()
2021-12-13 21:16:04 +03:00
Oleg Matrokhin
8b03b41b7a
Add number representation assists
2021-12-13 19:35:38 +03:00
bors[bot]
69500e8c6b
Merge #11002
...
11002: fix: Add support for v6 macro metadata format r=lnicola a=lnicola
CC https://github.com/rust-analyzer/rust-analyzer/issues/10894#issuecomment-991993824
bors r+
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-12-13 16:17:14 +00:00
Laurențiu Nicola
e6af1ca718
Add support for v6 macro metadata format
2021-12-13 18:15:22 +02:00
bors[bot]
e1f3982a5f
Merge #11001
...
11001: minor: fixup generate assist priorities r=Veykril a=Veykril
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10996
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-12-13 15:51:54 +00:00
bors[bot]
3f550d2e38
Merge #11000
...
11000: fix: insert whitespaces into assoc items for assist when macro generated r=Veykril a=Veykril
This is obviously only a temporary hack which still produces ugly looking items, but as long as the syntax is valid one can at least have rustfmt fix the formatting again.
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/6588
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-12-13 15:43:12 +00:00
Lukas Wirth
1cef532c4d
minor: fixup generate assist priorities
2021-12-13 16:42:21 +01:00
Lukas Wirth
749eeef3e7
fix: insert whitespaces into assoc items for assist when macro generated
2021-12-13 16:35:32 +01:00
Lukas Wirth
328419534d
Move ws insert rendering for macro expansion into ide_db
2021-12-13 15:55:13 +01:00
Aleksey Kladov
3b5b988526
prettyfy
2021-12-12 19:36:14 +03:00
Aleksey Kladov
980dd56cdc
consistency
2021-12-12 19:32:04 +03:00
Aleksey Kladov
6e4bb57014
simplify
2021-12-12 19:31:32 +03:00
Aleksey Kladov
57e6ef0bfb
tighten up invariants
2021-12-12 19:22:37 +03:00
Aleksey Kladov
18d4737fb9
add cross-crate inlines
2021-12-12 19:17:04 +03:00
Aleksey Kladov
1055a6111a
port mbe to soa tokens
2021-12-12 19:06:40 +03:00
Aleksey Kladov
965585748e
more orthogonal interface
2021-12-12 18:38:49 +03:00
Aleksey Kladov
6ce587ba5a
parser tests work
2021-12-12 18:31:05 +03:00
Aleksey Kladov
26bfd6023f
Switch parser to use tokens
2021-12-12 16:54:09 +03:00
Aleksey Kladov
d5ad0f3ca0
use eof token pattenr
2021-12-12 16:54:09 +03:00
Aleksey Kladov
addfd8d9e8
start SOA parser interface
2021-12-12 16:54:09 +03:00
bors[bot]
fc628cfc89
Merge #10993
...
10993: minor: Bump deps r=lnicola a=lnicola
Gets `coutme 2.0`.
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-12-12 11:11:50 +00:00
Laurențiu Nicola
8782e8e704
Bump deps
2021-12-12 13:10:21 +02:00
bors[bot]
40159150aa
Merge #10951
...
10951: feat: assist to generate documentation templates r=Veykril a=numero-744
Closes #10878 , #1915 and #4767
Full description is in #10878 , better read [the tests](https://github.com/rust-analyzer/rust-analyzer/pull/10951/files#diff-7a64e2efb66b2625443340fcbc96d531baff12c17cc0aaf51885ea94f67de254R424 ) to understand what this feature does.
- [x] There is one remaining thing about non-`pub` functions, what do you think about it?
- [x] In this PR [empty examples are generated](https://github.com/rust-analyzer/rust-analyzer/pull/10951/files#diff-7a64e2efb66b2625443340fcbc96d531baff12c17cc0aaf51885ea94f67de254R99 ) for `trait` functions, but maybe no examples should be provided at all.
- [x] If there is already a documentation, add another one with a separator ([currently done](https://github.com/rust-analyzer/rust-analyzer/pull/10951/files#diff-7a64e2efb66b2625443340fcbc96d531baff12c17cc0aaf51885ea94f67de254R74 )) or simply disable this assist?
- [x] I will check once more that the generated examples are correct (ie. they are easy to fill before that they are built and tested)
Comments appreciated 😄
Co-authored-by: Côme ALLART <come.allart@etu.emse.fr>
2021-12-11 22:58:49 +00:00
Côme ALLART
0e89f2f346
feat: remove should_panic example generation
2021-12-11 22:46:54 +01:00
Côme ALLART
9e53db274b
refactor: use hir to test if a value is returned
2021-12-11 20:52:14 +01:00
Côme ALLART
80a68685db
refactor: use Itertools::intersperse
2021-12-11 20:41:23 +01:00
Côme ALLART
7266fdb5a4
refactor: use hir to compare returned and self types
2021-12-11 20:33:08 +01:00
Florian Diebold
d599f819e0
Fix expected type calculation in struct literal if followed by comma
2021-12-11 18:47:45 +01:00
bors[bot]
0eb6039e4e
Merge #10987
...
10987: fix: respect inner attributes for Structs and Enums r=lnicola a=rainy-me
fix : #10980 (the allow/deny issue is not fully resolved though.)
Co-authored-by: rainy-me <github@yue.coffee>
2021-12-11 17:20:14 +00:00
rainy-me
a0c52794bd
fix: lookup upwards for struct and enum
2021-12-12 01:23:27 +09:00
bors[bot]
4f04d8477a
Merge #10965
...
10965: minor: Remove dead assists-related function r=Veykril a=lnicola
Unless I'm missing something, `assists_with_fixes` seems to be always used and ends up in the same code path.
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-12-11 15:06:52 +00:00
bors[bot]
48cd733c9e
Merge #10956 #10986
...
10956: minor: Bump deps r=Veykril a=lnicola
bors r+
10986: fix: Fix lint completions not working for unclosed attributes r=Veykril a=Veykril
Fixes #10682
Uses keywords and nested `TokenTree`s as a heuristic to figure out when to stop parsing in case the attribute is unclosed which should work pretty well as attributes are usually followed by either of those.
bors r+
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-12-11 14:58:07 +00:00