Aleksey Kladov
73b0f9dc04
internal: remove dead code
2021-09-15 21:22:06 +03:00
bors[bot]
911659a166
Merge #10048
...
10048: fix: correctly complete macro call if cursor at `!` r=Veykril a=unexge
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/9904
Co-authored-by: unexge <unexge@gmail.com>
2021-09-15 18:13:09 +00:00
Lukas Wirth
aa1b36dc6d
Downmap the token in attribute inputs when expanding speculatively
2021-09-14 00:04:04 +02:00
Lukas Wirth
2b907652ee
Speculatively expand attributes in completions
2021-09-13 19:30:23 +02:00
Lukas Wirth
40a2faee65
Enable flyimport for ident patterns
2021-09-01 16:13:53 +02:00
unexge
e0e7f0c170
Move "complete macro call if cursor at !
token" logic to MacroRender
2021-09-01 09:11:20 +03:00
unexge
c0d2b44250
fix: correctly complete macro call if cursor at !
2021-08-26 19:44:46 +03:00
Lukas Wirth
2e733b1a3e
Simplify
2021-08-14 19:09:36 +02:00
Lukas Wirth
bf918046fa
Only complete type annotations for patterns in function params
2021-08-14 18:18:32 +02:00
Lukas Wirth
73b7b34f89
Fill out expected type for functional update syntax completion
2021-08-11 18:12:44 +02:00
Lukas Wirth
b96f1adf5c
Give TypeInfo fields and methods more appropriate names
2021-08-03 17:28:51 +02:00
Lukas Wirth
25ff7171c4
Introduce TypeInfo
2021-08-03 16:41:53 +02:00
Lukas Wirth
1edbaa29f9
Wrap inner tail expressions in MissingOkOrSomeInTailExpr
2021-07-31 20:00:09 +02:00
Jonas Schievink
8764cc955f
Make flyimport respect #[doc(hidden)]
2021-07-28 19:22:59 +02:00
Jonas Schievink
0fbf396f0d
Make most completions respect #[doc(hidden)]
2021-07-28 15:59:02 +02:00
Jonas Schievink
3efdf6861f
Complete editable private items
2021-07-23 19:57:16 +02:00
Jonas Schievink
b0f7aac72f
Respect #[doc(hidden)]
in dot-completion
2021-07-23 15:36:43 +02:00
Tom Dohrmann
7b20904e8b
hide keyword suggestions in non trivial paths
2021-07-21 12:53:50 +02: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
Aleksey Kladov
9a3eae8755
fix: don't add duplicate &
during completion
2021-06-20 19:37:58 +03:00
Aleksey Kladov
2e4df27132
minor: use minicore
2021-06-18 22:25:35 +03:00
bors[bot]
ce926aebc4
Merge #9315
...
9315: Nest all the or-patterns! r=Veykril a=Veykril
`cargo +nightly clippy --fix -Z unstable-options --allow-dirty -- -A clippy::all -D clippy::unnested_or_patterns`
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-17 16:22:32 +00:00
Lukas Wirth
95c8c65139
Nest all the or-patterns!
2021-06-17 17:37:14 +02:00
Lukas Wirth
2a48b53220
Correct completions in items tests
2021-06-17 15:43:21 +02:00
Lukas Wirth
9353f36516
Fix incorrect completions in empty braced use statement
2021-06-17 13:59:31 +02:00
Lukas Wirth
2225db2eb4
Refine self
, super
and crate
completion in use paths
2021-06-17 13:56:55 +02:00
Lukas Wirth
aa644b5585
Move test_utils into tests module
2021-06-16 21:51:52 +02:00
Lukas Wirth
11115ebad8
Don't complete paths after attributes
2021-06-16 21:51:21 +02:00
Lukas Wirth
9ea6ee6b27
Don't show incorrect completions after unsafe or visiblity node
2021-06-16 21:51:20 +02:00
Lukas Wirth
1a8f76a224
Don't complete visibility accessors after existing ones
2021-06-16 21:51:20 +02:00
Lukas Wirth
354ad29493
Filter out non-type completions in the respective completions modules instead
2021-06-16 15:08:44 +02:00
Maan2003
75370312fb
clippy::redundant_closure
2021-06-13 09:29:36 +05:30
Maan2003
c9b4ac5be4
clippy::redudant_borrow
2021-06-13 09:24:16 +05:30
Lukas Wirth
1d74ef1d98
Don't complete values in type position
2021-06-08 16:50:10 +02:00
Lukas Wirth
2987e05f15
simplify
2021-06-07 20:45:17 +02:00
Lukas Wirth
b29e8ed994
Remove unnecessary completion::macro_in_item_position
2021-06-07 19:46:25 +02:00
Lukas Wirth
aa29364f83
Reorder CompletionContext fields
2021-06-07 19:06:03 +02:00
Lukas Wirth
4eabcb2c01
Move more things into PathCompletionContext
2021-06-07 14:08:05 +02:00
Lukas Wirth
e475bcdcc6
Simplify CompletionContext by introducing a path CallKind enum
2021-06-06 20:02:26 +02:00
Matthias Krüger
9452dfaac7
NFC: remove redundant clones (clippy::perf)
2021-06-03 15:32:46 +02:00
Lukas Wirth
76fd1b316f
Remove obsolete is_new_item field on CompletionContext
2021-06-02 17:12:36 +02:00
Lukas Wirth
9271941a95
Add MethodCall and FieldAccess variants to ImmediateLocation
2021-06-02 15:21:18 +02:00
Lukas Wirth
5660408f0a
Move more fields to ImmediateLocation
2021-05-30 21:35:01 +02:00
Lukas Wirth
47ad752e6c
Implement prev sibling determination for CompletionContext
2021-05-28 22:03:31 +02:00
Lukas Wirth
a6b92a8cc0
simplify
2021-05-28 20:46:09 +02:00
Lukas Wirth
9e71dd9799
Only complete modules in empty use-statements
2021-05-28 02:42:47 +02:00
Lukas Wirth
3a16950fd9
Cleanup ImmediateLocation
determination
2021-05-27 18:16:39 +02:00
Lukas Wirth
f41c983424
Don't complete non-macro item paths in impls and modules
2021-05-27 12:23:36 +02:00
Lukas Wirth
30948e1ecb
simplify
2021-05-27 03:47:20 +02:00
Lukas Wirth
6ec4ea8d9e
simplify
2021-05-27 03:15:48 +02:00
Lukas Wirth
7de925b8ab
Collapse more CompletionContext booleans into enums
2021-05-27 02:54:49 +02:00
Lukas Wirth
1f897f7319
Set record_pat_syntax
more precisely in CompletionContext
2021-05-26 23:46:00 +02:00
Lukas Wirth
7d865ef071
Merge pattern completion related bools into an enum
2021-05-26 22:39:47 +02:00
Lukas Wirth
26e784a575
simplify
2021-05-26 21:09:27 +02:00
Aleksey Kladov
45112aa8c0
internal: rename hypothetical -> speculative
...
Lets steal this good naming from Roslyn before I forget about it yet
again.
2021-05-24 22:21:25 +03:00
Florian Diebold
b8262099cc
Get rid of field_type again
2021-05-23 23:54:35 +02:00
Florian Diebold
e65803748d
Infer correct expected type in closure
...
Sadly currently only works if the closure body isn't completely missing.
2021-05-23 18:45:44 +02:00
Florian Diebold
7a0c93c58a
Infer correct expected type for generic struct fields
2021-05-23 18:45:44 +02:00
Florian Diebold
4a6cdd776d
Record method call substs and use them in call info
2021-05-23 18:24:21 +02:00
Lukas Wirth
174f043c8d
Add =
to pattern recovery
2021-05-08 23:14:08 +02:00
Kirill Bulatov
607d8a2f61
Small macro fix
2021-05-06 20:12:30 +03:00
Aleksey Kladov
6a16ec52aa
internal: use API stabilized in 1.52
2021-05-06 20:12:15 +03:00
Lukas Tobias Wirth
121bd5c533
Make CompletionContext expected_type smarter
2021-05-03 21:34:34 +02:00
Aleksey Kladov
cb3ef552e8
internal: normalize name
...
All def types in hir are unsubstituted
2021-04-30 11:52:31 +03:00
Lukas Wirth
f3c7499be5
Add '
to trigger_characters, allowing more direct lifetime completions
2021-03-21 11:05:04 +01:00
Lukas Wirth
64957acb5f
Fix incorrect scoping in while expressions
2021-03-21 01:28:42 +01:00
Lukas Wirth
62a4677dbc
Add label completion
2021-03-21 01:02:22 +01:00
bors[bot]
090e013161
Merge #8124
...
8124: Add basic lifetime completion r=Veykril a=Veykril
This adds basic lifetime completion, basic in the sense that the completions for lifetimes are only shown when the user enters `'` followed by a char. Showing them when nothing is entered is kind of a pain, as we would want them to only show up where they are useful which in turn requires a lot of tree traversal and cursor position checking to verify whether the position is valid for a lifetime. This in itself doesn't seem too bad as usually when you know you want to write a lifetime putting `'` to ask for lifetime completions seems fine.
~~I'll take a look at whether its possible to lift the restriction of having to put a char after `'`.~~ This actually already works so I guess this is the clients responsibility, in which case VSCode doesn't like it.
![TYH9gIlyVo](https://user-images.githubusercontent.com/3757771/111886437-c9b02f80-89cd-11eb-9bee-340f1536b0de.gif )
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-03-20 22:32:25 +00:00
Lukas Wirth
3c000c6364
Add basic lifetime completion
2021-03-20 23:25:07 +01:00
Lukas Wirth
38048c35d8
Don't use an untyped String for ActiveParam tracking
2021-03-20 23:22:09 +01:00
bors[bot]
da5328a01b
Merge #8051
...
8051: Fix more unused wariable warnings r=lnicola a=lnicola
bors r+
changelog skip
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-03-16 13:35:26 +00:00
Laurențiu Nicola
a7cf976c63
Fix more unused wariable warnings
2021-03-16 15:34:19 +02:00
Aleksey Kladov
f5a81ec468
Upgrade rowan
...
Notably, new rowan comes with support for mutable syntax trees.
2021-03-16 16:10:49 +03:00
Laurențiu Nicola
e941cb0238
Drop non-working mark
2021-03-15 16:05:16 +02:00
Josh Mcguigan
d91151c3b1
update algorithm for determining expected type of completion
2021-03-15 05:38:19 -07:00
Laurențiu Nicola
fc9eed4836
Use upstream cov-mark
2021-03-08 22:19:44 +02:00
Aleksey Kladov
3db64a400c
rename completion -> ide_completion
...
We don't have completion-related PRs in flight, so lets do it
2021-02-17 17:53:31 +03:00