Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
source_jump.hpp
Go to the documentation of this file.
1// source_jump.hpp — Inspector source-jump: resolve a view's authored
2// source location and open it in the user's editor.
3//
4// This is the concrete "jump to source" action. The editor-URI
5// configuration lives in pulp/inspect/editor_url.hpp; source locations
6// are recorded on `pulp::view::View` from React's `__source` prop. This
7// file ties them together:
8//
9// 1. resolve_source_jump() — given a config + a View's recorded
10// source location, format the editor URL via format_editor_url().
11// 2. launch_editor_url() — hand the URL to the OS so the editor
12// actually opens. Kept behind a small seam so headless tests can
13// run the resolve path with `dryRun` and never spawn a process.
14//
15// The launch shim deliberately lives in inspect/ (dev-tooling), not in
16// core/runtime — it is only ever used by the inspector overlay and the
17// inspector protocol handler, and is not part of the SDK public API.
18#pragma once
19
21
22#include <optional>
23#include <string>
24#include <string_view>
25
26namespace pulp::view { class View; }
27
28namespace pulp::inspect {
29
35 bool ok = false;
36 std::string url;
37 std::string path;
38 int line = 0;
39 int col = 0;
40 bool launched = false;
41 std::string error;
42};
43
50 const pulp::view::View* view);
51
61bool launch_editor_url(std::string_view url, std::string* error = nullptr);
62
69 bool dry_run);
70
71} // namespace pulp::inspect
Definition view.hpp:73
Definition agent_context.hpp:7
bool launch_editor_url(std::string_view url, std::string *error=nullptr)
Hand an editor URL to the OS handler.
SourceJumpResult jump_to_source(const InspectorConfig &config, const pulp::view::View *view, bool dry_run)
Convenience: resolve + launch in one call.
SourceJumpResult resolve_source_jump(const InspectorConfig &config, const pulp::view::View *view)
Resolve the source-jump target for view using config's editor URL template (with environment override...
Hover-cursor tracking for platform window hosts.
Definition fwd.hpp:27
@ error
Definition design_ir.hpp:697
Inspector runtime configuration.
Definition editor_url.hpp:38
Outcome of a source-jump resolution.
Definition source_jump.hpp:34
bool ok
Definition source_jump.hpp:35
std::string error
Human-readable failure reason (empty on ok).
Definition source_jump.hpp:41
int col
Resolved 1-based column (0 = unknown).
Definition source_jump.hpp:39
bool launched
True if the URL was handed to the OS.
Definition source_jump.hpp:40
int line
Resolved 1-based line (0 = unknown).
Definition source_jump.hpp:38
std::string url
Formatted editor URL (empty on failure).
Definition source_jump.hpp:36
std::string path
Resolved source file path.
Definition source_jump.hpp:37