Skip to content

Commit

Permalink
Stack trace tweaks part 3
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp committed Oct 3, 2024
1 parent 99cf0e4 commit 261923e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions frontend/components/ErrorMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`  <span
Expand All @@ -46,7 +48,7 @@ const DocLink = ({ frame }) => {
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</a
></span
Expand Down

0 comments on commit 261923e

Please sign in to comment.