Skip to content

Commit

Permalink
Fix scip inherent impl overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
darichey committed Jan 28, 2025
1 parent d60afec commit 1eb9f5e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/tools/rust-analyzer/crates/rust-analyzer/src/cli/scip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,14 +444,14 @@ impl SymbolGenerator {
MonikerResult::Moniker(moniker) => TokenSymbols {
symbol: scip::symbol::format_symbol(moniker_to_symbol(moniker)),
enclosing_symbol: None,
is_inherent_impl: moniker
.identifier
.description
.get(moniker.identifier.description.len() - 2)
.is_some_and(|descriptor| {
is_inherent_impl: match &moniker.identifier.description[..] {
// inherent impls are represented as impl#[SelfType]
[.., descriptor, _] => {
descriptor.desc == MonikerDescriptorKind::Type
&& descriptor.name == "impl"
}),
}
_ => false,
},
},
MonikerResult::Local { enclosing_moniker } => {
let local_symbol = scip::types::Symbol::new_local(local_count);
Expand Down

0 comments on commit 1eb9f5e

Please sign in to comment.