mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-25 19:35:06 +00:00
Fix the symbol query limit
This commit is contained in:
parent
d50a1a0fe9
commit
54936e8aa2
1 changed files with 4 additions and 3 deletions
|
@ -300,9 +300,6 @@ impl Query {
|
||||||
let mut stream = op.union();
|
let mut stream = op.union();
|
||||||
let mut res = Vec::new();
|
let mut res = Vec::new();
|
||||||
while let Some((_, indexed_values)) = stream.next() {
|
while let Some((_, indexed_values)) = stream.next() {
|
||||||
if res.len() >= self.limit {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
for indexed_value in indexed_values {
|
for indexed_value in indexed_values {
|
||||||
let symbol_index = &indices[indexed_value.index];
|
let symbol_index = &indices[indexed_value.index];
|
||||||
let (start, end) = SymbolIndex::map_value_to_range(indexed_value.value);
|
let (start, end) = SymbolIndex::map_value_to_range(indexed_value.value);
|
||||||
|
@ -314,6 +311,10 @@ impl Query {
|
||||||
if self.exact && symbol.name != self.query {
|
if self.exact && symbol.name != self.query {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if res.len() >= self.limit {
|
||||||
|
return res;
|
||||||
|
}
|
||||||
res.push(symbol.clone());
|
res.push(symbol.clone());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue