mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
internal: Lift out item list path completions from (un)qualified_path
This commit is contained in:
parent
52a58f672e
commit
25d133e3b8
13 changed files with 97 additions and 68 deletions
|
@ -270,13 +270,17 @@ impl<'a> CompletionContext<'a> {
|
|||
|| matches!(self.name_ctx, Some(NameContext::RecordField))
|
||||
}
|
||||
|
||||
pub(crate) fn has_impl_or_trait_prev_sibling(&self) -> bool {
|
||||
/// Whether the cursor is right after a trait or impl header.
|
||||
/// trait Foo ident$0
|
||||
// FIXME: This probably shouldn't exist
|
||||
pub(crate) fn has_unfinished_impl_or_trait_prev_sibling(&self) -> bool {
|
||||
matches!(
|
||||
self.prev_sibling,
|
||||
Some(ImmediatePrevSibling::ImplDefType | ImmediatePrevSibling::TraitDefName)
|
||||
)
|
||||
}
|
||||
|
||||
// FIXME: This probably shouldn't exist
|
||||
pub(crate) fn has_impl_prev_sibling(&self) -> bool {
|
||||
matches!(self.prev_sibling, Some(ImmediatePrevSibling::ImplDefType))
|
||||
}
|
||||
|
@ -289,6 +293,7 @@ impl<'a> CompletionContext<'a> {
|
|||
matches!(self.prev_sibling, Some(ImmediatePrevSibling::IfExpr))
|
||||
}
|
||||
|
||||
// FIXME: This shouldn't exist
|
||||
pub(crate) fn is_path_disallowed(&self) -> bool {
|
||||
self.previous_token_is(T![unsafe])
|
||||
|| matches!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue