Skip to content

Commit cc77bdf

Browse files
committed
Auto-completion no longer occurs on comments
1 parent 0bbd642 commit cc77bdf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/ra_ide/src/completion/complete_keyword.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! FIXME: write short doc here
22
3-
use ra_syntax::ast;
3+
use ra_syntax::{ast, SyntaxKind};
44

55
use crate::completion::{
66
CompletionContext, CompletionItem, CompletionItemKind, CompletionKind, Completions,
@@ -37,6 +37,10 @@ pub(super) fn complete_use_tree_keyword(acc: &mut Completions, ctx: &CompletionC
3737
}
3838

3939
pub(super) fn complete_expr_keyword(acc: &mut Completions, ctx: &CompletionContext) {
40+
if ctx.token.kind() == SyntaxKind::COMMENT {
41+
return;
42+
}
43+
4044
let has_trait_or_impl_parent = ctx.has_impl_parent || ctx.has_trait_parent;
4145
if ctx.trait_as_prev_sibling || ctx.impl_as_prev_sibling {
4246
add_keyword(ctx, acc, "where", "where ");

0 commit comments

Comments
 (0)