Skip to content

Feature: Open callback implementation in editor#959

Merged
srzeszut merged 18 commits into
mainfrom
688-link-to-code-where-callback-is-implemented-in-callback-traces
Apr 3, 2026
Merged

Feature: Open callback implementation in editor#959
srzeszut merged 18 commits into
mainfrom
688-link-to-code-where-callback-is-implemented-in-callback-traces

Conversation

@srzeszut

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds “Open in editor” support for callback traces by resolving a trace’s source file/line from BEAM debug info and wiring UI buttons to invoke the configured editor command.

Changes:

  • Introduces LiveDebugger.Utils.FunctionMatcher to resolve the matching function clause and return a %SourceLocation{}.
  • Persists resolved source locations onto function traces and exposes an “open in editor” button across trace views (inline + fullscreen).
  • Refactors editor-opening logic into Editor.open_in_editor/4, adds JS tooltip behavior to hide on scroll, and expands tests.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/utils/function_matcher_test.exs Adds tests for clause/guard matching and source resolution.
test/app/debugger/utils/editor_test.exs Adds tests for editor command success/failure flash behavior.
lib/live_debugger/utils/function_matcher.ex Implements clause matching + source location extraction from debug info.
lib/live_debugger/structs/trace/function_trace.ex Adds SourceLocation struct and :source field to traces.
lib/live_debugger/app/debugger/web/live_components/node_basic_info.ex Switches “open in editor” handling to Editor.open_in_editor/4 and centralizes docs URL.
lib/live_debugger/app/debugger/utils/editor.ex Adds docs URL helper + async open-in-editor with flash-on-error.
lib/live_debugger/app/debugger/callback_tracing/web/node_traces_live.ex Passes editor config through trace components.
lib/live_debugger/app/debugger/callback_tracing/web/hook_components/trace_wrapper.ex Adds open-in-editor event handling and source resolution/persistence when expanding traces.
lib/live_debugger/app/debugger/callback_tracing/web/global_traces_live.ex Passes editor config through trace components.
lib/live_debugger/app/debugger/callback_tracing/web/components/trace.ex Adds “open in editor” UI button in multiple trace layouts.
lib/live_debugger/app/debugger/callback_tracing/structs/trace_display.ex Surfaces trace source location into display struct.
dev/live_views/main.ex Adds a guarded clause to support guard-matching test coverage.
assets/app/hooks/tooltip.js Hides tooltip on scroll via a window scroll listener.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/live_debugger/app/debugger/callback_tracing/web/components/trace.ex Outdated
Comment thread lib/live_debugger/structs/trace/function_trace.ex Outdated
Comment thread lib/live_debugger/app/debugger/callback_tracing/structs/trace_display.ex Outdated
Comment thread assets/app/hooks/tooltip.js
Comment thread dev/live_views/main.ex
@srzeszut srzeszut marked this pull request as ready for review March 27, 2026 15:35

@hhubert6 hhubert6 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

Comment thread lib/live_debugger/app/debugger/callback_tracing/web/components/trace.ex Outdated
Comment thread lib/live_debugger/app/debugger/callback_tracing/web/components/trace.ex Outdated
Comment thread lib/live_debugger/utils/function_matcher.ex
Comment thread test/utils/function_matcher_test.exs Outdated
@srzeszut srzeszut requested a review from hhubert6 April 2, 2026 09:38

@kraleppa kraleppa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome 🔥 🔥

@hhubert6 hhubert6 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐬🌊

@srzeszut srzeszut merged commit 27ec700 into main Apr 3, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Link to code where callback is implemented in callback traces

4 participants