diff options
author | Aleksey Kladov <[email protected]> | 2020-07-30 17:02:20 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-07-30 17:02:20 +0100 |
commit | 3cd4112bdc924c132cb0eab9d064511a215421ec (patch) | |
tree | f651b475d9c799a772fd37e89405f80a04ea953e /crates/ra_ide/src/completion | |
parent | 6b25f640a6ad8e2322b5cc0664223b742459336d (diff) |
Finalize const&static grammar
Diffstat (limited to 'crates/ra_ide/src/completion')
-rw-r--r-- | crates/ra_ide/src/completion/complete_trait_impl.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_ide/src/completion/complete_trait_impl.rs b/crates/ra_ide/src/completion/complete_trait_impl.rs index 7d9050a6b..88679f3bd 100644 --- a/crates/ra_ide/src/completion/complete_trait_impl.rs +++ b/crates/ra_ide/src/completion/complete_trait_impl.rs | |||
@@ -2,7 +2,7 @@ | |||
2 | //! | 2 | //! |
3 | //! This module adds the completion items related to implementing associated | 3 | //! This module adds the completion items related to implementing associated |
4 | //! items within a `impl Trait for Struct` block. The current context node | 4 | //! items within a `impl Trait for Struct` block. The current context node |
5 | //! must be within either a `FN`, `TYPE_ALIAS`, or `CONST_DEF` node | 5 | //! must be within either a `FN`, `TYPE_ALIAS`, or `CONST` node |
6 | //! and an direct child of an `IMPL_DEF`. | 6 | //! and an direct child of an `IMPL_DEF`. |
7 | //! | 7 | //! |
8 | //! # Examples | 8 | //! # Examples |
@@ -87,7 +87,7 @@ pub(crate) fn complete_trait_impl(acc: &mut Completions, ctx: &CompletionContext | |||
87 | } | 87 | } |
88 | } | 88 | } |
89 | 89 | ||
90 | SyntaxKind::CONST_DEF => { | 90 | SyntaxKind::CONST => { |
91 | for missing_fn in get_missing_assoc_items(&ctx.sema, &impl_def) | 91 | for missing_fn in get_missing_assoc_items(&ctx.sema, &impl_def) |
92 | .into_iter() | 92 | .into_iter() |
93 | .filter_map(|item| match item { | 93 | .filter_map(|item| match item { |
@@ -108,7 +108,7 @@ fn completion_match(ctx: &CompletionContext) -> Option<(SyntaxNode, ImplDef)> { | |||
108 | let (trigger, impl_def_offset) = ctx.token.ancestors().find_map(|p| match p.kind() { | 108 | let (trigger, impl_def_offset) = ctx.token.ancestors().find_map(|p| match p.kind() { |
109 | SyntaxKind::FN | 109 | SyntaxKind::FN |
110 | | SyntaxKind::TYPE_ALIAS | 110 | | SyntaxKind::TYPE_ALIAS |
111 | | SyntaxKind::CONST_DEF | 111 | | SyntaxKind::CONST |
112 | | SyntaxKind::BLOCK_EXPR => Some((p, 2)), | 112 | | SyntaxKind::BLOCK_EXPR => Some((p, 2)), |
113 | SyntaxKind::NAME_REF => Some((p, 5)), | 113 | SyntaxKind::NAME_REF => Some((p, 5)), |
114 | _ => None, | 114 | _ => None, |
@@ -201,7 +201,7 @@ fn add_const_impl( | |||
201 | } | 201 | } |
202 | } | 202 | } |
203 | 203 | ||
204 | fn make_const_compl_syntax(const_: &ast::ConstDef) -> String { | 204 | fn make_const_compl_syntax(const_: &ast::Const) -> String { |
205 | let const_ = edit::remove_attrs_and_docs(const_); | 205 | let const_ = edit::remove_attrs_and_docs(const_); |
206 | 206 | ||
207 | let const_start = const_.syntax().text_range().start(); | 207 | let const_start = const_.syntax().text_range().start(); |