microsoft / microsoft/vscode-livepreview

fragment/anchor in Uri is ignored when preview loose file

Open
#660 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
596
Forks
119
Avg merge
1d 4m
Merged PRs (30d)
5

Description

when I call command livePreview.start.preview.atFile from my extension and pass a vscode.Uri which contains a fragment.

const htmlFile = 'file:///home/quan/test.html#section2';
const uri = vscode.Uri.parse(htmlFile);
vscode.commands.executeCommand('livePreview.start.preview.atFile', uri);

The html is previewed successfully. however,the fragment is ignored. the preview browser did not jump to section2 in test.html

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the livePreview.start.preview.atFile command entry point and trace how the vscode.Uri is converted into the preview URL. Reproduce the issue with a URI containing #section2 and confirm that the preview navigates to section2 in test.html when the fragment is preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
devtools, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.