Preview tool should support opening local HTML files directly
Feature Request
The preview_start tool currently only works with dev servers (localhost URLs). It would be useful to also support opening local HTML files directly via file:// paths, without requiring the user to spin up an HTTP server.
Use Case
When working with tools that generate HTML reports (e.g., data analysis pipelines, test coverage reports, static site generators), the natural workflow is:
- Run the tool that generates an HTML file
- View the result in the preview
Currently this requires setting up a launch.json with a Python HTTP server or similar just to serve a static file, which is unnecessary overhead.
Current Workaround
{
"version": "0.0.1",
"configurations": [
{
"name": "data-server",
"runtimeExecutable": "python3",
"runtimeArgs": ["-m", "http.server", "8765", "--directory", "output"],
"port": 8765
}
]
}
Proposed Behavior
Allow preview_start (or a new tool like preview_open) to accept a local file path and open it directly in the preview panel, e.g.:
preview_open("/path/to/report.html")
This would be especially helpful for:
- HTML reports from data analysis tools
- Test coverage reports
- Generated documentation
- Any static HTML output from build tools
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗