Lukas Wirth
d2cf8c234a
Make else autocompletion work in more places
2023-02-12 10:49:57 +01:00
Duong Quoc Khanh
58136b01ba
Add more tests for completion without body.
...
Add tests for Fn, Const, TypeAlias without body inside Trait.
2023-02-09 17:32:55 +09:00
Duong Quoc Khanh
a7df61f1d3
Add postfix completion for unsafe
.
...
Wrap receiver_text with { } if it's not a BlockExpr.
2023-02-07 23:55:44 +09:00
Ryo Yoshida
a4d0b5c522
Add regression tests
2023-02-05 22:28:03 +09:00
Maybe Waffle
249ea9502d
Set "current" edition to 2021
2023-01-31 10:51:43 +00:00
Lukas Wirth
f8ed4d7ae4
Use lang item resolution instead of known paths
2023-01-21 19:03:36 +01: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
bvanjoi
67cbd8f7c1
fix(completion): remove bound insert of type in trait
2022-12-23 18:45:25 +08:00
yue4u
1ca5cb7ed9
fix: also exclude 2 coloncolon in a row
2022-11-27 02:39:38 +09:00
yue4u
e1de04d60c
fix: only special casing 3 colon in a row
2022-11-27 01:53:45 +09:00
yue4u
7a568f7f95
fix: remove insufficient check for coloncolon
2022-11-20 01:29:02 +09:00
yue4u
f26d5484d8
fix: filter unnecessary completions after colon
2022-11-12 22:33:40 +09:00
Lukas Wirth
90e2db8126
fix: Fix item completions not working properly after unit structs and outline modules
2022-11-08 08:37:45 +01:00
Lukas Wirth
ad17ba12d1
Complete variants and assoc items in path pattern through type aliases
2022-09-16 16:11:58 +02:00
austaras
748567cba5
complete full struct in enum varaint
2022-09-05 03:36:14 +08:00
Aleksey Kladov
d7ef3f51ec
fix: correct broken logic for return complition
...
It seems that we've accidentally deleted the tests here couple of years
ago, and then fairly recently made a typo during refactor as well.
Reinstall tests, with coverage marks this time :-)
2022-09-04 18:12:55 +01:00
Dezhi Wu
23747419ca
fix: a bunch of typos
...
This PR will fix some typos detected by [typos].
There are also some other typos in the function names, variable names, and file
names, which I leave as they are. I'm more certain that typos in comments
should be fixed.
[typos]: https://github.com/crate-ci/typos
2022-08-17 21:44:58 +08:00
yue4u
91358bd937
fix: format literal lookup
2022-08-16 01:24:21 +09:00
Lukas Wirth
b3ac58dfb8
Add some more cov_mark
s
2022-08-09 18:08:05 +02:00
Lukas Wirth
8c9359b072
Fix pattern field completions not working for unions
2022-08-09 17:53:16 +02:00
cynecx
902fd6ddcd
fix: complete path of existing record expr
2022-07-29 17:24:05 +02:00
Lukas Wirth
ce7541260d
fix: Don't complete marker traits in expression position
2022-07-28 17:50:49 +02:00
Lukas Wirth
7c59d7c75c
fix: Fix pattern completions adding unnecessary braces
2022-07-28 15:47:46 +02:00
Lukas Wirth
e782e59d3d
fix: Calculate completions after type anchors
2022-07-28 10:06:36 +02:00
bors
96481b7786
Auto merge of #12773 - Veykril:self-compl, r=Veykril
...
fix: Improve self param completion applicability
Fixes https://github.com/rust-lang/rust-analyzer/issues/9522
2022-07-16 10:28:52 +00:00
Lukas Wirth
b96f8f18b0
fix: Improve self param completion applicability
2022-07-16 12:28:41 +02:00
Lukas Wirth
7ff6c36716
fix: Don't show qualified path completions for private items
2022-07-15 13:30:43 +02:00
feniljain
4cbde4ed8f
fix(completion): super::
completion at crate root and module depth
...
aware
2022-07-14 17:07:43 +05:30
Hongxu Xu
3248601a03
fix default type param value position
2022-07-07 07:28:55 +08:00
Hongxu Xu
75fb3de310
Handle generic args per arg index
...
Add more test cases for generic args
2022-07-07 00:45:22 +08:00
Hongxu Xu
0f2eba54db
Show only assoc type args in the correct arg pos
2022-07-06 22:58:27 +08:00
Hongxu Xu
441e659aa1
Complete associated type only in trait generic arg
...
Fix tidy check does not work for marks in multiline
2022-07-05 21:48:28 +08:00
bors
d101439c77
Auto merge of #12627 - yue4u:fix/struct-variant-patterns, r=Veykril
...
fix: complete enum variants as patterns in pattern path
close #12593
2022-07-02 17:18:24 +00:00
Lukas Wirth
cd42b20ce3
fix: Trigger flyimport completions in item lists again
2022-07-02 16:20:26 +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
Lukas Wirth
531e152390
fix: Simplify macro statement expansion handling
2022-07-01 14:49:30 +02:00
bors
9eaf96c9ea
Auto merge of #12643 - Veykril:macro-compl, r=Veykril
...
fix: Fix completions for locals not working properly inside macro calls
2022-06-27 12:40:46 +00:00
Lukas Wirth
bdbffdd463
fix: Fix completions for locals not working properly inside macro calls
2022-06-27 14:39:44 +02:00
Antonello Palazzi
bef89e95e7
Udate unit tests
2022-06-27 09:04:42 +01:00
yue4u
472ae16bfb
fix: completes non exhaustive variant within the defining crate
2022-06-24 00:00:51 +09:00
Lukas Wirth
7a0774defa
internal: Simplify some completions
2022-06-20 21:55:33 +02:00
Lukas Wirth
06ee4d6222
fix: Fix auto-ref completions inserting into wrong locations
2022-06-20 18:59:57 +02:00
Lukas Wirth
1f028403cd
fix: Don't trigger pattern completions when typing a wildcard pattern
2022-06-20 18:03:09 +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
bors
7322a982f9
Auto merge of #12554 - XFFXFF:fix_11959, r=Veykril
...
fix: local items should not be completed in parent signature
fixes #11959
> We get a Bar completion for the following snippet which is wrong as the item is not visible in that position.
> ``` rust
> fn foo() -> $0 {
> struct Bar;
> }
> ```
I investigated the problem and found that the scope of the cursor offset, also `CompletionContext.scope` is the body of the function
2022-06-16 12:48:33 +00:00