bors
f77b68a3cb
Auto merge of #13860 - danieleades:clippy, r=lnicola
...
fix a bunch of clippy lints
fixes a bunch of clippy lints for fun and profit
i'm aware of this repo's position on clippy. The changes are split into separate commits so they can be reviewed separately
2023-01-08 17:29:57 +00:00
Brent Westbrook
150da92b5c
return immediately from render_record_lit if snippet_cap is None
...
this is the record literal version of #13805 , which handled the same issue for
tuple literals
2023-01-04 12:55:05 -05:00
Daniel Eades
ed128872eb
remove needless borrows
2023-01-02 14:52:32 +00:00
Laurențiu Nicola
3aae785693
Avoid useless format
2022-12-30 16:10:07 +02:00
Yuri Astrakhan
e16c76e3c3
Inline all format arguments where possible
...
This makes code more readale and concise,
moving all format arguments like `format!("{}", foo)`
into the more compact `format!("{foo}")` form.
The change was automatically created with, so there are far less change
of an accidental typo.
```
cargo clippy --fix -- -A clippy::all -W clippy::uninlined_format_args
```
2022-12-24 14:36:10 -05:00
Yuri Astrakhan
1d59c7b667
Remove non-needed clones
...
I am not certain if this will improve performance,
but it seems having a .clone() without any need should be removed.
This was done with clippy, and manually reviewed:
```
cargo clippy --fix -- -A clippy::all -D clippy::redundant_clone
```
2022-12-23 02:20:03 -05:00
Brent Westbrook
694ae77bf6
pass snippet_cap to format_literal_label, return early if None
2022-12-20 11:27:19 -05:00
Brent Westbrook
1116cc93ec
return immediately from render_tuple_lit if snippet_cap is None
...
partially addresses #13767
2022-12-20 11:07:37 -05:00
Lukas Wirth
6c5d15800e
fix: Fix reference autocompletions using incorrect offsets in macro inputs
...
Fixes https://github.com/rust-lang/rust-analyzer/issues/13035
2022-08-23 14:29:59 +02:00
yue4u
91358bd937
fix: format literal lookup
2022-08-16 01:24:21 +09:00
Ryo Yoshida
018266a7ff
Make ModPath display escaped path
2022-08-11 03:41:10 +09:00
Ryo Yoshida
8fe73a2240
Make tests pass
2022-08-11 01:16:35 +09:00
Ryo Yoshida
4322cf7f5b
Remove EscapedName
2022-08-11 01:11:18 +09:00
Lukas Wirth
7c59d7c75c
fix: Fix pattern completions adding unnecessary braces
2022-07-28 15:47:46 +02:00
hi-rustin
349dfc7e95
Find original ast node before compute ref match in fn render
...
Signed-off-by: hi-rustin <rustin.liu@gmail.com >
2022-07-27 20:18:00 +08:00
Amos Wenger
816f7fe12a
Run cargo fix --edition-idioms
2022-07-20 15:02:08 +02:00
Lukas Wirth
b96f8f18b0
fix: Improve self param completion applicability
2022-07-16 12:28:41 +02:00
Jonas Schievink
6c6ae965ba
Update remaining GitHub URLs
2022-07-08 15:44:49 +02:00
yue4u
ea7ea7079c
fix: escape for enum variant
2022-07-02 23:17:29 +09:00
yue4u
622b516c74
fix: variants rendering in pattern path
2022-07-02 20:31:24 +09:00
Hongxu Xu
f536766efb
complete raw identifier with "r#" prefix
2022-06-26 14:45:30 +08:00
yue4u
472ae16bfb
fix: completes non exhaustive variant within the defining crate
2022-06-24 00:00:51 +09:00
Lukas Wirth
46d22719fc
Remove pattern rendering hack
2022-06-20 20:16:40 +02:00
Lukas Wirth
06ee4d6222
fix: Fix auto-ref completions inserting into wrong locations
2022-06-20 18:59:57 +02:00
Lukas Wirth
6e9c963348
internal: Lift out IdentContext from CompletionContext
2022-06-20 17:41:04 +02:00
Lukas Wirth
309ecdd71c
internal: NameRefKind classification is not optional
2022-06-18 08:58:47 +02:00
Lukas Wirth
173bb10a76
internal: Split flyimport into its 3 applicable contexts
2022-06-18 00:47:28 +02:00
Lukas Wirth
00fdb4a3d8
Only run completion functions if their corresponding context is active
2022-06-17 23:36:39 +02:00
Lukas Wirth
6e07b17f69
Introduce NameRefKind for completions
2022-06-17 10:45:19 +02:00
yue4u
11693dad88
fix: avoid adding enum parens in use
2022-06-06 01:34:01 +09:00
Lukas Wirth
a2a74bf278
Remove some of the unnecessary helpfer functions from CompletionContext
2022-06-03 20:49:25 +02:00
Lukas Wirth
c5dcc77b40
Fix visibility mods not being completed for field defs
2022-06-03 15:42:28 +02:00
Lukas Wirth
697ade6f8d
internal: Simplify DotAccess representation in completions
2022-05-24 11:54:50 +02:00
Lukas Wirth
3577c44dee
fix: Fix fill-arguments completions not working
2022-05-13 19:52:44 +02:00
Lukas Wirth
26fef97d59
Simplify
2022-05-10 14:31:28 +02:00
Lukas Wirth
44c3cc100b
Merge the different identifier contexts into one enum
2022-05-07 15:06:59 +02:00
Lukas Wirth
6a045c7029
Introduce NameRefContext
2022-05-07 13:46:43 +02:00
Lukas Wirth
0ce620686c
fix: Fix snippets triggering where they shouldn't
2022-05-06 15:44:41 +02:00
Lukas Wirth
57a9915c1f
internal: completion PathKind is not optional
2022-05-06 12:04:41 +02:00
Lukas Wirth
8b092ec337
internal: Lift out macro bang property from PathKind enum
2022-05-05 10:51:02 +02:00
Peh
1f011fa4a3
style: rename crates to kebab case
2022-05-01 10:48:58 +00:00