-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File models get disposed when contents change on disk #20901
Comments
I am writing an extension which will preview the DFM, and what I want to preview is a virtual Html resource, this Html will reference to some js files(in relative path), but the VSCode will translate it into absolute path based on the markdown file, I fix this problem by translate the js files's path into absolute path, but when this js files reference to other files, I don't know how to do.Maybe you can provide some advice. |
When I use the first ways to preview Html(provide a Uri), how to trigger the update event. |
When the URI points to a file on disk and that file is inside the current workspace/folder updating happens automatically, when you are showing a virtual resource its content provider must signal changes via an event. Therefore a |
There is a small sample, it doesn't behavior as what you said. |
Can you reduce that to something small and simple? |
Yes! Sample is smaller! |
I was writing an extension, which is going to preview DocFx. Extension pass the markdown content to a child process, which will use DocFx engine to render the markdown file into Html, this Html will be written to a temp file, which is the resource of preview page, But When this temp Html changed, Nothing happens to preview page. |
Is this file inside the workspace or did you open the file by itself? Can you open it in source and check if it updates when it is changed on disk? |
The situation is, this file is inside the workspace, but not be opened, and When it is changed by another editor or process, it can't update automatically. |
Thanks for sticking with me. There is actually something wrong. The preview updates as long as the file also open in an editor and stops after that. I need to investigate.. |
This happens because the
I don't understand that. There is the |
Thank you for reopening this issue, I have already solved my problem through another way, but I still want to see this problem can be fixed, thank you! |
Command "vscode.previewHtml" can only provide two ways to preview a Html resource.
The one is providing Url, but when the Html file changes, how to update the preview content? Is there some sample code?
The second is providing a virtual resource, but when I want to use some js files to render this Html, do I have to give the absolute path? If so, How can I do when js file reference to another js file(in this case, it have to be a relative path(?)).
The text was updated successfully, but these errors were encountered: