Improve resolution of base path in workspace proxy server #359
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've noticed the workspace proxy server is not handling the base path of workspace URI correctly.
In the multiple workspace, a URI for each workspace root may become
virtual-workspace://multiple-workspaces/root
. If resolved path such as/abc.jpg
, we have to resolve the image fromvirtual-workspace://multiple-workspaces/root/abc.jpg
. However, currently we wrongly resolvevirtual-workspace://multiple-workspaces/abc.jpg
by following the rule of absolute path.This change may resolve the file resolution issue in some virtual workspaces,
such as #238.In addition, this fix is opening the door for working on
file
scheme URI, and it brings more compatible file path resoluition with VS Code's Markdown preview to the export command. (Specifically,/abc.jpg
can point at the workspace root, not filesystem root. It may become a breaking change to exist projects so the workspace-based resolution infile
scheme should be an optional)