From cc77bdf59ad99d3522663ebdb80be553f2767290 Mon Sep 17 00:00:00 2001 From: BGluth Date: Fri, 26 Jun 2020 20:09:11 -0600 Subject: Auto-completion no longer occurs on comments --- crates/ra_ide/src/completion/complete_keyword.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'crates/ra_ide') diff --git a/crates/ra_ide/src/completion/complete_keyword.rs b/crates/ra_ide/src/completion/complete_keyword.rs index 3b174f916..e599cc3d1 100644 --- a/crates/ra_ide/src/completion/complete_keyword.rs +++ b/crates/ra_ide/src/completion/complete_keyword.rs @@ -1,6 +1,6 @@ //! FIXME: write short doc here -use ra_syntax::ast; +use ra_syntax::{ast, SyntaxKind}; use crate::completion::{ CompletionContext, CompletionItem, CompletionItemKind, CompletionKind, Completions, @@ -37,6 +37,10 @@ pub(super) fn complete_use_tree_keyword(acc: &mut Completions, ctx: &CompletionC } pub(super) fn complete_expr_keyword(acc: &mut Completions, ctx: &CompletionContext) { + if ctx.token.kind() == SyntaxKind::COMMENT { + return; + } + let has_trait_or_impl_parent = ctx.has_impl_parent || ctx.has_trait_parent; if ctx.trait_as_prev_sibling || ctx.impl_as_prev_sibling { add_keyword(ctx, acc, "where", "where "); -- cgit v1.2.3