Small token fix

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
Kirill Bulatov 2021-01-18 21:20:02 +02:00
parent d1ac3293f4
commit f01cfe9114

View File

@ -73,7 +73,7 @@ pub(crate) fn import_on_the_fly(acc: &mut Completions, ctx: &CompletionContext)
}
let potential_import_name = {
let token_kind = ctx.token.kind();
if token_kind == T![.] || token_kind == T![::] {
if matches!(token_kind, T![.] | T![::]) {
String::new()
} else {
ctx.token.to_string()