Commit Graph

287 Commits

Author SHA1 Message Date
Lukas Wirth
d5947d9d48 Clarify what the outline test module is for 2021-07-22 20:03:29 +02:00
Lukas Wirth
2d696b9c9e Move out record completion tests 2021-07-22 19:38:49 +02:00
bors[bot]
0bee7cb716
Merge #9453
9453: Add first-class limits. r=matklad,lnicola a=rbartlensky

Partially fixes #9286.

This introduces a new `Limits` structure which is passed as an input
to `SourceDatabase`. This makes limits accessible almost everywhere in
the code, since most places have a database in scope.

One downside of this approach is that whenever you query limits, you
essentially do an `Arc::clone` which is less than ideal.

Let me know if I missed anything, or would like me to take a different approach!

Co-authored-by: Robert Bartlensky <bartlensky.robert@gmail.com>
2021-07-22 10:33:05 +00:00
Lukas Wirth
03efb50ae8 Move out fn_param tests 2021-07-21 21:39:40 +02:00
Lukas Wirth
9485d6efba Fix some clippy lints in ide_completion 2021-07-21 19:52:10 +02:00
Lukas Wirth
ccde0bcd1f Only complete ancestors and self in visibility path completions 2021-07-21 18:54:12 +02:00
Lukas Wirth
3956a5b757 Simplify 2021-07-21 18:34:43 +02:00
Tom Dohrmann
7b20904e8b hide keyword suggestions in non trivial paths 2021-07-21 12:53:50 +02:00
Lukas Wirth
c83e37c001 cov-mark 2021-07-20 19:00:52 +02:00
bors[bot]
33972da625
Merge #9651
9651: Restrict completions inside visibility modifiers r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-07-20 16:38:40 +00:00
Lukas Wirth
f6cb42fdb8 Restrict completions inside visibility modifiers 2021-07-20 18:37:52 +02:00
mahdi-frms
65839f4069 add 'use' prefix for any auto-import 2021-07-20 18:35:19 +04:30
Robert Bartlensky
0b3d0cde8b Add Limit struct.
Fixes #9286.
2021-07-19 13:26:11 +01:00
Aleksey Kladov
15f11dce4a feat: improve parser error recovery for function parameters 2021-07-17 22:41:04 +03:00
Lukas Wirth
efc96b2c60 Add regression test fo #7222 2021-07-15 22:23:34 +02:00
Lukas Wirth
317b0c2e6d Move attribute completion tests 2021-07-15 16:27:01 +02:00
Levente Gyozo Lenart
a3f0197454 Update tests 2021-07-14 18:20:01 +02:00
Levente Gyozo Lenart
a0bc236adf Add true and false as completion suggestions when expecting an expression 2021-07-14 18:19:47 +02:00
bors[bot]
87621de2b9
Merge #9567 #9568
9567: remove unneded special case r=matklad a=matklad

bors r+
🤖

9568: feat: add 'for' postfix completion r=lnicola a=mahdi-frms


![Peek 2021-07-11 16-45](https://user-images.githubusercontent.com/62165556/125194692-a0aaf780-e267-11eb-952a-81de7955d9a1.gif)


adds #9561

used ```ele``` as identifier for each element in the iteration

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Co-authored-by: mahdi-frms <mahdif1380@outlook.com>
2021-07-11 12:51:33 +00:00
mahdi-frms
7bae9c9187 add 'for' postfix completion 2021-07-11 17:10:57 +04:30
vi_mi
1338ddbe80 add: Adding self keyword completion in complete_fn_param 2021-07-10 16:11:15 +05:30
Lukas Wirth
2e8f3fee3f Add test for trait completion label edit 2021-07-07 19:54:58 +02:00
Lukas Wirth
68f68534c6 Don't add the trait name to the insert text in completions 2021-07-07 19:42:09 +02:00
Lukas Wirth
9f9cc72ee5 Complete crate, super and self in non-usetree paths 2021-07-07 19:08:37 +02:00
mahdi-frms
6ac54319ea show 'as' or 'use' before label traits 2021-07-05 16:44:44 +04:30
bors[bot]
b52306ed37
Merge #9493
9493: minor: drop dummy authors field r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-07-05 11:20:21 +00:00
Aleksey Kladov
86720f2953 minor: drop dummy authors field 2021-07-05 14:19:41 +03:00
mahdi-frms
02d33c9856 eliminate find_use_path and show 'as' and 'use' 2021-07-05 02:15:31 +04:30
mahdi-frms
486bffc23e show imported trait on autocompletion of associated items 2021-07-05 02:13:49 +04:30
Aleksey Kladov
9b3292541c internal: improve feedback for relevance tests 2021-07-04 17:03:28 +03:00
Aleksey Kladov
fbb9d69758 feat: always prefer postfix snippets if there's exact textual match
Note that, while we don't currently have a fuzzy-matching score, it
makes sense to special-case postfix templates -- it's very annoying when
`.not()` gets sorted before `.not`. We might want to move this infra to
fuzzy matching, once we have that!
2021-07-04 16:50:02 +03:00
Aleksey Kladov
6e9780c005 internal: make CompletionItem and SourceChange consistent
Before this PR, SourceChange used a bool and CompletionItem used an enum
to signify if edit is a snippet. It makes sense to use the same pattern
in both cases. `bool` feels simpler, as there's only one consumer of
this API, and all producers are encapsulated anyway (we check the
capability at the production site).
2021-07-04 15:44:03 +03:00
Aleksey Kladov
e9d52c23b3 minor: fix lint completion sourcegen 2021-07-04 11:30:56 +03:00
Aleksey Kladov
660930623e feat: regenrate lint completions 2021-07-03 22:24:36 +03:00
Aleksey Kladov
58d2ece88a internal: overhaul code generation
* Keep codegen adjacent to the relevant crates.
* Remove codgen deps from xtask, speeding-up from-source installation.

This regresses the release process a bit, as it now needs to run the
tests (and, by extension, compile the code).
2021-07-03 22:11:03 +03:00
bors[bot]
c8d0ca8080
Merge #9398
9398: minor: Complete `macro_use` attribute on modules r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-24 20:21:20 +00:00
Lukas Wirth
63b1394b70 Complete macro_use attribute on modules 2021-06-24 22:20:56 +02:00
Lukas Wirth
85736f2dc9 Fix incorrect base fixture in ide_completion tests 2021-06-23 19:13:27 +02:00
Lukas Wirth
9abd28ac37 Restrict type bound completions to traits, modules and macros 2021-06-23 19:10:03 +02:00
Lukas Wirth
d4877ae992 Add predicate tests for ide_completions 2021-06-23 18:58:19 +02:00
Lukas Wirth
dc4876d33d Lift out base item fixture for ide_completion tests 2021-06-23 18:37:47 +02:00
Jamie Cunliffe
ae823aa23f Move features into potential_cfg_options 2021-06-21 17:54:05 +01:00
Jamie Cunliffe
284483b347 Improve completion of cfg attributes
The completion of cfg will look at the enabled cfg keys when
performing completion.

It will also look crate features when completing a feature cfg
option. A fixed list of known values for some cfg options are
provided.

For unknown keys it will look at the enabled values for that cfg key,
which means that completion will only show enabled options for those.
2021-06-21 17:47:00 +01:00
bors[bot]
c69f762f26
Merge #9356
9356: internal: Move out and regroup more completion tests r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-21 13:15:12 +00:00
Lukas Wirth
0729913525 Various keyword completion fixes 2021-06-21 15:14:28 +02:00
Lukas Wirth
b9d85f55b7 Move out completion type position tests 2021-06-21 15:00:53 +02:00
Lukas Wirth
f835279b3a Move out completion pattern tests 2021-06-21 13:48:25 +02:00
Aleksey Kladov
9a3eae8755 fix: don't add duplicate & during completion 2021-06-20 19:37:58 +03:00
bors[bot]
d9666ce509
Merge #9334
9334: feat: Allow to disable import insertion on single path glob imports r=Veykril a=Veykril

On by default as I feel like this is something the majority would prefer.

Closes #8490

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-18 21:23:22 +00:00
Lukas Wirth
2ee090faaf Allow to disable import insertion on single path glob imports 2021-06-18 23:11:56 +02:00