Skip to content

Commit

Permalink
fix no tooltip being displayed for unknown wrappedMethod
Browse files Browse the repository at this point in the history
  • Loading branch information
SpontanCombust committed Jun 15, 2024
1 parent 9570659 commit c5fac47
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion crates/lsp/src/providers/hover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -974,12 +974,19 @@ impl RenderTooltip for MemberVarInjectorSymbol {

impl RenderTooltip for WrappedMethodSymbol {
fn render(&self, buf: &mut String, _: &SymbolTable, marcher: &SymbolTableMarcher<'_>) {
let mut rendered = false;

// skip the wrapper function to get to either another wrapper or the original function
if let Some(wrapped) = marcher.redefinition_chain(&self.wrapped_path()).skip(1).next() {
// wrapped symbol should be in other content, so we need to fetch the correct one for it
if let Some(symtab) = marcher.find_table_with_symbol(wrapped) {
wrapped.render(buf, symtab, marcher)
wrapped.render(buf, symtab, marcher);
rendered = true;
}
}

if !rendered {
buf.push_str(&SymbolPathBuf::unknown(SymbolCategory::Callable).to_string());
}
}
}

0 comments on commit c5fac47

Please sign in to comment.