mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-28 18:43:01 +00:00
Fix scip inherent impl overflow
This commit is contained in:
parent
606cfeffa2
commit
50172919a6
1 changed files with 6 additions and 6 deletions
|
|
@ -444,14 +444,14 @@ impl SymbolGenerator {
|
||||||
MonikerResult::Moniker(moniker) => TokenSymbols {
|
MonikerResult::Moniker(moniker) => TokenSymbols {
|
||||||
symbol: scip::symbol::format_symbol(moniker_to_symbol(moniker)),
|
symbol: scip::symbol::format_symbol(moniker_to_symbol(moniker)),
|
||||||
enclosing_symbol: None,
|
enclosing_symbol: None,
|
||||||
is_inherent_impl: moniker
|
is_inherent_impl: match &moniker.identifier.description[..] {
|
||||||
.identifier
|
// inherent impls are represented as impl#[SelfType]
|
||||||
.description
|
[.., descriptor, _] => {
|
||||||
.get(moniker.identifier.description.len() - 2)
|
|
||||||
.is_some_and(|descriptor| {
|
|
||||||
descriptor.desc == MonikerDescriptorKind::Type
|
descriptor.desc == MonikerDescriptorKind::Type
|
||||||
&& descriptor.name == "impl"
|
&& descriptor.name == "impl"
|
||||||
}),
|
}
|
||||||
|
_ => false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
MonikerResult::Local { enclosing_moniker } => {
|
MonikerResult::Local { enclosing_moniker } => {
|
||||||
let local_symbol = scip::types::Symbol::new_local(local_count);
|
let local_symbol = scip::types::Symbol::new_local(local_count);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue