microsoft / microsoft/vscode-livepreview
Live Preview omits initial slash of URL pathname if `livePreview.openPreviewTarget` is "External Browser" and `livePreview.serverRoot` ends with a slash.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 596
- Forks
- 119
- Avg merge
- 1d 4m
- Merged PRs (30d)
- 5
Description
- Live Preview version: 0.4.15
- VS Code version: 1.101.1
- OS version: macOS 15.5
Steps to Reproduce:
- Create or open a workspace.
- Create a folder in the workspace root such as "public".
- In the workspace settings, set
livePreview.serverRootto that folder's path with a trailing slash (e.g. "/public/"). - In the workspace or user settings, set
livePreview.openPreviewTargetto "External Browser". - Create or open an HTML file in the folder from step 2 such as
/public/index.html. - Open a preview of that file.
Expected result: VS Code tells the default browser to open http://127.0.0.1:3000/index.html.
Actual result: VS Code tells the default browser to open http://127.0.0.1:3000index.html/.
(See screenshot. Note the missing slash between port and filename, and the appended trailing slash.)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the URL construction used when livePreview.openPreviewTarget is "External Browser", reproducing the case with livePreview.serverRoot set to "/public/" and an index.html file. Done means the external browser receives http://127.0.0.1:3000/index.html, with neither the missing slash nor the appended trailing slash.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- devtools, web-dev
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 64/100