mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-03 18:43:38 +00:00
Qualify ast types
This commit is contained in:
parent
e9643ab74c
commit
8f4478390e
@ -3,10 +3,7 @@
|
|||||||
//! This module uses a bit of static metadata to provide completions
|
//! This module uses a bit of static metadata to provide completions
|
||||||
//! for built-in attributes.
|
//! for built-in attributes.
|
||||||
|
|
||||||
use ra_syntax::{
|
use ra_syntax::{ast, AstNode, SyntaxKind};
|
||||||
ast::{self, AttrInput, AttrKind},
|
|
||||||
AstNode, SyntaxKind,
|
|
||||||
};
|
|
||||||
use rustc_hash::FxHashSet;
|
use rustc_hash::FxHashSet;
|
||||||
|
|
||||||
use crate::completion::{
|
use crate::completion::{
|
||||||
@ -18,7 +15,9 @@ pub(super) fn complete_attribute(acc: &mut Completions, ctx: &CompletionContext)
|
|||||||
let attribute = ctx.attribute_under_caret.as_ref()?;
|
let attribute = ctx.attribute_under_caret.as_ref()?;
|
||||||
|
|
||||||
match (attribute.path(), attribute.input()) {
|
match (attribute.path(), attribute.input()) {
|
||||||
(Some(path), Some(AttrInput::TokenTree(token_tree))) if path.to_string() == "derive" => {
|
(Some(path), Some(ast::AttrInput::TokenTree(token_tree)))
|
||||||
|
if path.to_string() == "derive" =>
|
||||||
|
{
|
||||||
complete_derive(acc, ctx, token_tree)
|
complete_derive(acc, ctx, token_tree)
|
||||||
}
|
}
|
||||||
_ => complete_attribute_start(acc, ctx, attribute),
|
_ => complete_attribute_start(acc, ctx, attribute),
|
||||||
@ -42,7 +41,7 @@ fn complete_attribute_start(acc: &mut Completions, ctx: &CompletionContext, attr
|
|||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
if attribute.kind() == AttrKind::Inner || !attr_completion.should_be_inner {
|
if attribute.kind() == ast::AttrKind::Inner || !attr_completion.should_be_inner {
|
||||||
acc.add(item);
|
acc.add(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user