From 261923e147aa77ed4300f27eb5130a1746e30e50 Mon Sep 17 00:00:00 2001 From: Fons van der Plas Date: Thu, 3 Oct 2024 13:02:12 +0200 Subject: [PATCH] Stack trace tweaks part 3 --- frontend/components/ErrorMessage.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/components/ErrorMessage.js b/frontend/components/ErrorMessage.js index 03db50bd1..efc704dba 100644 --- a/frontend/components/ErrorMessage.js +++ b/frontend/components/ErrorMessage.js @@ -28,15 +28,17 @@ const focus_line = (cell_id, line) => const DocLink = ({ frame }) => { let pluto_actions = useContext(PlutoActionsContext) + if (extract_cell_id(frame.file)) return null if (frame.parent_module == null) return null if (ignore_funccall(frame)) return null - const nb = pluto_actions.get_notebook() + const funcname = frame.call.split("(")[0] + if (funcname === "") return null + const nb = pluto_actions.get_notebook() const pkg_name = frame.source_package const builtin = ["Main", "Core", "Base"].includes(pkg_name) const installed = nb?.nbpkg?.installed_versions?.[frame.source_package] != null - if (!builtin && nb?.nbpkg != null && !installed) return null return html`   { onClick=${(e) => { e.preventDefault() open_bottom_right_panel("docs") - pluto_actions.set_doc_query(`${frame.parent_module}.${frame.call.split("(")[0]}`) + pluto_actions.set_doc_query(`${frame.parent_module}.${funcname}`) }} >docs