Open quanzhuo opened 2 months ago
More information:
If the html file to be previewed is in a workspace folder which is not a loose file.
construct the file uri like this will jump to the fragment. But the uri is not a valid vscode.Uri
actually.
const uri = vscode.Uri.file('D:\\workspace\\cmake\\test\\qtimeline.html#duration-prop');
vscode.commands.executeCommand('livePreview.start.preview.atFile', uri);
construct the file uri like this (which is a valid vscode.Uri
) not work:
const uri = vscode.Uri.file('D:\\workspace\\cmake\\test\\qtimeline.html').with({ fragment: 'duration-prop' });
vscode.commands.executeCommand('livePreview.start.preview.atFile', uri);
when I call command
livePreview.start.preview.atFile
from my extension and pass avscode.Uri
which contains a fragment.The html is previewed successfully. however,the fragment is ignored. the preview browser did not jump to section2 in test.html