diff options
author | Florian Diebold <[email protected]> | 2020-03-13 14:18:17 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2020-03-16 17:38:19 +0000 |
commit | 6305d094ac61ed6e437537b93f4e587b415678c9 (patch) | |
tree | 89ec8942a287c8a1f6d2955602fe1a3415262cac /crates/ra_ide/src/completion/complete_scope.rs | |
parent | b973158aeb337041d4e1434cf5d8c609a0b02bef (diff) |
Attempt to implement ranking of rules when none matches perfectly (wip)
Diffstat (limited to 'crates/ra_ide/src/completion/complete_scope.rs')
-rw-r--r-- | crates/ra_ide/src/completion/complete_scope.rs | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/crates/ra_ide/src/completion/complete_scope.rs b/crates/ra_ide/src/completion/complete_scope.rs index 5ffff5a1c..2733922f8 100644 --- a/crates/ra_ide/src/completion/complete_scope.rs +++ b/crates/ra_ide/src/completion/complete_scope.rs | |||
@@ -811,7 +811,44 @@ mod tests { | |||
811 | } | 811 | } |
812 | " | 812 | " |
813 | ), | 813 | ), |
814 | @"[]" | 814 | @r###" |
815 | [ | ||
816 | CompletionItem { | ||
817 | label: "m!", | ||
818 | source_range: [145; 145), | ||
819 | delete: [145; 145), | ||
820 | insert: "m!($0)", | ||
821 | kind: Macro, | ||
822 | detail: "macro_rules! m", | ||
823 | }, | ||
824 | CompletionItem { | ||
825 | label: "quux(…)", | ||
826 | source_range: [145; 145), | ||
827 | delete: [145; 145), | ||
828 | insert: "quux(${1:x})$0", | ||
829 | kind: Function, | ||
830 | lookup: "quux", | ||
831 | detail: "fn quux(x: i32)", | ||
832 | trigger_call_info: true, | ||
833 | }, | ||
834 | CompletionItem { | ||
835 | label: "x", | ||
836 | source_range: [145; 145), | ||
837 | delete: [145; 145), | ||
838 | insert: "x", | ||
839 | kind: Binding, | ||
840 | detail: "i32", | ||
841 | }, | ||
842 | CompletionItem { | ||
843 | label: "y", | ||
844 | source_range: [145; 145), | ||
845 | delete: [145; 145), | ||
846 | insert: "y", | ||
847 | kind: Binding, | ||
848 | detail: "i32", | ||
849 | }, | ||
850 | ] | ||
851 | "### | ||
815 | ); | 852 | ); |
816 | } | 853 | } |
817 | 854 | ||