aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/completion/completion_item.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-04-24 17:05:16 +0100
committerGitHub <[email protected]>2020-04-24 17:05:16 +0100
commit5d97667f8dd467e7382885fcae40bcdbac63ae4f (patch)
tree5fd1a5271033937b50f78bcbb1b62a3ade027d33 /crates/ra_ide/src/completion/completion_item.rs
parentedd6f91cab77c4fabf449a50f4f65e4761c98ca4 (diff)
parent0dab5d58790d46e28d738c0d1d96e833a61495a1 (diff)
Merge #4105
4105: Adds attribute completions (#3941) r=matklad a=jrvidal I've hacked together some basic completions for a few builtin attributes. * I have no idea what `CompletionItemKind` we should set for them. * There's plenty of fancy stuff we could do by detecting the item the attribute is being added to. Nothing of that here. * Maybe we could complete as soon as you type `#` or `#!`? I'm not sure what info exactly we can dump on `CompletionContext` and what we should query during the completion calculation itself. I've assumed adding an `is_attribute` field is OK, since it allows to discard the completion quickly if it doesn't apply. Later we inspect the AST to find out whether it is an inner attribute or not. Co-authored-by: Roberto Vidal <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/completion/completion_item.rs')
-rw-r--r--crates/ra_ide/src/completion/completion_item.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/ra_ide/src/completion/completion_item.rs b/crates/ra_ide/src/completion/completion_item.rs
index fb06cc125..5936fb8f7 100644
--- a/crates/ra_ide/src/completion/completion_item.rs
+++ b/crates/ra_ide/src/completion/completion_item.rs
@@ -121,6 +121,7 @@ pub enum CompletionItemKind {
121 Method, 121 Method,
122 TypeParam, 122 TypeParam,
123 Macro, 123 Macro,
124 Attribute,
124} 125}
125 126
126#[derive(Debug, PartialEq, Eq, Copy, Clone)] 127#[derive(Debug, PartialEq, Eq, Copy, Clone)]
@@ -134,6 +135,7 @@ pub(crate) enum CompletionKind {
134 Snippet, 135 Snippet,
135 Postfix, 136 Postfix,
136 BuiltinType, 137 BuiltinType,
138 Attribute,
137} 139}
138 140
139#[derive(Debug, PartialEq, Eq, Copy, Clone)] 141#[derive(Debug, PartialEq, Eq, Copy, Clone)]