Skip to content

✨ feat: register a URI handler, so anything can open a log in the viewer #931

Description

@lukecotter

✨ Feature Request

Register a URI handler, so anything outside VS Code can open a log in the viewer.

🧩 Problem This Solves

Nothing outside VS Code can ask the extension to open a log.

lana.showLogAnalysis already takes a vscode.Uri
(lana/src/commands/ShowLogAnalysis.ts:15-17), and activation covers both
onLanguage:apexlog and onStartupFinished, so the capability is there. But
package.json declares no uriHandler and extension.ts calls no
vscode.window.registerUriHandler, so there is no vscode://financialforce.lana/...
entry point.

Only code already running inside the extension host can call executeCommand. A
separate process cannot.

🧠 Proposed Solution

Register a URI handler that maps to the two existing commands:

vscode://FinancialForce.lana/showLogAnalysis?path=<absolute log path>
vscode://FinancialForce.lana/showInLogAnalysis?timestamp=<ns>&path=<absolute log path>

The second matches the undeclared lana.showInLogAnalysis, which already takes
{ timestamp, filePath? }.

Notes for whoever picks this up:

  • Insiders uses the vscode-insiders:// scheme. vscode.env.uriScheme gives the running
    one, but a caller building the link from outside has to choose, so document both.
  • Validate path: it arrives from outside the editor. Refuse anything that is not an
    existing readable file.
  • Decide the behaviour when the path is not in any open workspace folder.

Acceptance

  • open "vscode://FinancialForce.lana/showLogAnalysis?path=/abs/path/to.log" opens the
    log in the analysis view from a cold editor.
  • A path that does not exist reports an error and opens nothing.

🔄 Alternatives

A fifth MCP tool, considered and rejected. The MCP server can run remotely, in a
container, or over SSH, where no VS Code is reachable, and the dependency runs the wrong
way — the extension registers the server, not the reverse. A URI is the right shape:
anything that can open a link can use it, and a caller that cannot reach a desktop simply
does not build one.

📎 Additional context

The Apex Log MCP server (certinia/debug-log-analyzer-mcp) is one caller. Every one of
its tools returns an absolute log file path, and apexlog_execute_anonymous writes a
new log to disk. An agent that has just found a slow operation has no way to say "show
me this in the viewer".

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions