mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
initial mod resolve
This commit is contained in:
parent
55e87e0b74
commit
081c16c776
6 changed files with 111 additions and 23 deletions
|
@ -62,10 +62,10 @@ impl Query {
|
|||
self.limit = limit
|
||||
}
|
||||
|
||||
pub(crate) fn process<'a>(
|
||||
pub(crate) fn process(
|
||||
&mut self,
|
||||
file: &'a FileSymbols,
|
||||
) -> Vec<&'a FileSymbol> {
|
||||
file: &FileSymbols,
|
||||
) -> Vec<FileSymbol> {
|
||||
fn is_type(kind: SyntaxKind) -> bool {
|
||||
match kind {
|
||||
STRUCT_DEF | ENUM_DEF | TRAIT_DEF | TYPE_DEF => true,
|
||||
|
@ -87,7 +87,7 @@ impl Query {
|
|||
if self.exact && symbol.name != self.query {
|
||||
continue;
|
||||
}
|
||||
res.push(symbol);
|
||||
res.push(symbol.clone());
|
||||
self.limit -= 1;
|
||||
}
|
||||
res
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue