mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Cleanup
This commit is contained in:
parent
afce8e4426
commit
d3df80dfe4
7 changed files with 17 additions and 27 deletions
|
@ -1,11 +1,11 @@
|
|||
use join_to_string::join;
|
||||
|
||||
use hir::{Docs, Resolution};
|
||||
|
||||
use crate::{
|
||||
completion::{CompletionItem, CompletionItemKind, Completions, CompletionKind, CompletionContext},
|
||||
};
|
||||
|
||||
use hir::Docs;
|
||||
|
||||
pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) {
|
||||
let path = match &ctx.path_prefix {
|
||||
Some(path) => path.clone(),
|
||||
|
@ -15,7 +15,7 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) {
|
|||
Some(Resolution::Def { def }) => def,
|
||||
_ => return,
|
||||
};
|
||||
match def_id {
|
||||
match def {
|
||||
hir::ModuleDef::Module(module) => {
|
||||
let module_scope = module.scope(ctx.db);
|
||||
for (name, res) in module_scope.entries() {
|
||||
|
|
|
@ -16,7 +16,7 @@ pub(crate) struct CompletionContext<'a> {
|
|||
pub(super) db: &'a db::RootDatabase,
|
||||
pub(super) offset: TextUnit,
|
||||
pub(super) leaf: &'a SyntaxNode,
|
||||
pub(super) resolver: Resolver<'static>,
|
||||
pub(super) resolver: Resolver,
|
||||
pub(super) module: Option<hir::Module>,
|
||||
pub(super) function: Option<hir::Function>,
|
||||
pub(super) function_syntax: Option<&'a ast::FnDef>,
|
||||
|
|
|
@ -4,6 +4,7 @@ use ra_syntax::{
|
|||
algo::find_node_at_offset,
|
||||
};
|
||||
use test_utils::tested_by;
|
||||
use hir::Resolution;
|
||||
|
||||
use crate::{FilePosition, NavigationTarget, db::RootDatabase, RangeInfo};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue