Lukas Wirth
cd9d76e0ca
internal: Store function param names in ItemTree
2021-12-20 15:24:37 +01:00
Lukas Wirth
f609efff87
Simplify
2021-12-20 14:38:22 +01:00
bors[bot]
77f2d34930
Merge #10950
...
10950: internal: completion: split out more PathKinds from ImmediateLocation r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-12-07 21:57:59 +00:00
Lukas Wirth
ae0c7268f7
internal: completion: split out more PathKinds from ImmediateLocation
2021-12-07 22:49:42 +01:00
Lukas Wirth
e09d410dcd
Simplify
2021-12-07 15:06:56 +01:00
Lukas Wirth
1f254dd855
feat: Enable flyimport completions for attributes
2021-12-05 15:57:28 +01:00
Lukas Wirth
0c98a01b3e
Remove possible multiline details in completions
2021-11-24 16:08:11 +01:00
Andrew Leverette
7f15537fa9
Add optimization for not allocating in case of no module path for struct literal
2021-11-23 14:41:31 -06:00
Andrew Leverette
ce7a141110
Add support for qualified struct names
2021-11-23 10:57:29 -06:00
Lukas Wirth
ab657af5b7
Add some completion profile spans
2021-11-08 19:41:16 +01:00
bors[bot]
c5c11b87cc
Merge #10720
...
10720: fix: Don't ascribe types in pattern completion for param patterns twice r=Veykril a=Veykril
Fixes #10323
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-11-08 13:12:03 +00:00
Lukas Wirth
7369360c15
Don't ascribe types in pattern completion for patterns twice
2021-11-05 18:39:36 +01:00
Lukas Wirth
2f5afba9f8
Replace some String usages with SmolStr in completions
2021-11-05 12:30:39 +01:00
Lukas Wirth
0468b11de7
Remove CompletionKind
in favor of CompletionItemKind
2021-10-27 17:23:43 +02:00
Lukas Wirth
791a2afbf9
Don't turn local names into strings in CompletionContext
2021-10-17 10:59:06 +02:00
k-nasa
b50cb5c261
Remove neesless clone
2021-10-10 10:50:51 +09:00
bors[bot]
c409cf0e26
Merge #10458
...
10458: feat: Implement custom user snippets r=Veykril a=Veykril
![Y24dX7fOWX](https://user-images.githubusercontent.com/3757771/136059454-ceccfc2c-2c90-46da-8ad1-bac9c2e83ec1.gif )
Allows us to address the following issues:
- `.arc / .rc / .pin, similar to .box?` https://github.com/rust-analyzer/rust-analyzer/issues/7033
- `Add unsafe snippet` https://github.com/rust-analyzer/rust-analyzer/issues/10392 , would allow users to have this without the diagnostic)
- `.ok() postfix snippet is annoying` https://github.com/rust-analyzer/rust-analyzer/issues/9636 , allows us to get rid of the `ok` postfix and similar ones
- `Postfix vec completion` https://github.com/rust-analyzer/rust-analyzer/issues/7773
cc https://github.com/rust-analyzer/rust-analyzer/issues/772
Zulipd discussion: https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/Custom.20Postfix.20snippets
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-10-05 16:41:11 +00:00
Aramis Razzaghipour
9583dd5725
Replace if let
with match
where appropriate
2021-10-05 09:00:21 +11:00
Lukas Wirth
454ecd167c
Make multiple import edits work for completions
2021-10-04 21:44:33 +02:00
Lukas Wirth
b6ed91a6de
Rename *Owner
traits to Has*
2021-09-27 12:54:24 +02:00
bors[bot]
c577e128fc
Merge #10248
...
10248: internal: remove dead code r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-09-15 18:23:46 +00:00
Aleksey Kladov
73b0f9dc04
internal: remove dead code
2021-09-15 21:22:06 +03:00
unexge
e0e7f0c170
Move "complete macro call if cursor at !
token" logic to MacroRender
2021-09-01 09:11:20 +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
Aleksey Kladov
0e437c809b
fix: add !
to macro completions with existing arg
2021-08-08 15:53:31 +03:00
Alexandre Fourcat
9beefef8f9
Add completion for struct literal in which all fields are visible.
...
Fix ide_completion tests.
Move 'complete_record_literal' call to the main completion function.
Fix a rendering bug when snippet not available.
Checks if an expression is expected before adding completion for struct literal.
Move 'completion struct literal with private field' test to 'expressions.rs' test file.
Update 'expect' tests with new check in 'complete record literal'.
2021-08-04 18:52:58 +02:00
Aleksey Kladov
08756012a5
internal: document query implication of completion rendering
2021-07-31 16:13:15 +03:00
Aleksey Kladov
d4e381f7b2
minor: follow code style
2021-07-31 16:05:07 +03:00
Lukas Wirth
9485d6efba
Fix some clippy lints in ide_completion
2021-07-21 19:52:10 +02: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
Lukas Wirth
95c8c65139
Nest all the or-patterns!
2021-06-17 17:37:14 +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
66b701ed3e
Simplify
2021-06-16 15:51:01 +02:00
Maan2003
c9b4ac5be4
clippy::redudant_borrow
2021-06-13 09:24:16 +05:30
Lukas Wirth
ec9ef9c283
Complete associated types in dyn and impl trait
2021-06-11 23:12:30 +02:00
Lukas Wirth
4e588dfd88
Don't allow lookup by self for unprefixed self access completions
2021-06-11 18:26:52 +02:00
Lukas Wirth
e475bcdcc6
Simplify CompletionContext by introducing a path CallKind enum
2021-06-06 20:02:26 +02:00
Lukas Wirth
9271941a95
Add MethodCall and FieldAccess variants to ImmediateLocation
2021-06-02 15:21:18 +02:00
Lukas Wirth
d346f5bf75
Less strings, more hir::Names
2021-05-31 14:55:16 +02:00
Lukas Wirth
ca49fbe0a1
Complete self.
prefixed fields and methods inside methods
2021-05-31 14:52:55 +02:00
Lukas Wirth
971b0836ef
Use Name
s instead of Strings in the completion rendering api
2021-05-31 14:15:15 +02:00
Lukas Wirth
439ae17e1b
Don't label derive macros with their banged_name
2021-05-28 14:59:24 +02:00
Aleksey Kladov
cb3ef552e8
internal: normalize name
...
All def types in hir are unsubstituted
2021-04-30 11:52:31 +03:00
Josh Mcguigan
0e31ae2cef
completion relevance distinguish between exact type match and could unify
2021-03-26 09:18:18 -07:00
Josh Mcguigan
8cd94900f7
implement a temporary workaround for #8058
2021-03-21 17:30:56 -07:00
Jonas Schievink
c05a1a6e37
Store an AstId
for procedural macros
2021-03-18 16:11:18 +01:00
bors[bot]
1a82af3527
Merge #7900 #8000
...
7900: show function params in completion detail r=matklad a=JoshMcguigan
This resolves #7842 by updating the detail for function completions from `-> T` to `fn(T, U) -> V`. I added an expicit unit test for this, `ide_completion::render::fn_detail_includes_args_and_return_type`, which passes.
Lots of other unit tests fail (~60 of them) due to this change, although I believe the failures are purely cosmetic (they were testing the exact format of this output). I'm happy to go update those tests, but before I do that I'd like to make sure this is in fact the format we want for the detail?
edit - I realized `UPDATE_EXPECT=1 cargo test` automatically updates `expect!` tests. Big 👍 to whoever worked on that! So I'll go ahead and update all these tests soon. But I still would like to confirm `fn(T, U) -> V` is the desired content in the `detail` field.
8000: Use hir formatter for hover text r=matklad a=oxalica
Fix #2765 , (should) fix #4665
Co-authored-by: Josh Mcguigan <joshmcg88@gmail.com>
Co-authored-by: oxalica <oxalicc@pm.me>
2021-03-16 08:05:24 +00:00