hide keyword suggestions in non trivial paths

This commit is contained in:
Tom Dohrmann 2021-07-21 12:53:50 +02:00
parent 478d435640
commit 7b20904e8b
3 changed files with 10 additions and 16 deletions

View file

@ -353,6 +353,10 @@ impl<'a> CompletionContext<'a> {
matches!(self.path_context, Some(PathCompletionContext { is_trivial_path: true, .. }))
}
pub(crate) fn is_non_trivial_path(&self) -> bool {
matches!(self.path_context, Some(PathCompletionContext { is_trivial_path: false, .. }))
}
pub(crate) fn path_qual(&self) -> Option<&ast::Path> {
self.path_context.as_ref().and_then(|it| it.qualifier.as_ref())
}