Create a URI from a file system path#40
Create a URI from a file system path#40vfonic wants to merge 1 commit intofabiospampinato:masterfrom
Conversation
* Instead of allowing parsing arbitrary URI schemas
|
The root issue seems to be that this function: vscode-projects-plus/src/utils.ts Lines 284 to 299 in ac34b75 isn't returning an actual file system path sometimes, I think the fix should be instead to return |
|
Hmmm, I'm not sure about that, that might be a separate issue. With the fix I provided here, I don't see the error message appearing on my machine anymore. |
Since the value that's getting passed to |
|
Are you sure that's what's happening? Maybe it's just that VSCode update introduced throwing these errors (warnings?) and your code works as good as it used to? I think using |
I think so, you can see from here where the value that's getting passed to
Maybe, realistically I don't see anyone manually adding some arbitrary path to their configuration though.
🤔 I see that function is being called also from here. I'll have to take a closer look at this 👍 |
Closes #39
The issue is due to
Uri.parseallowing any kind of URI, from 'untitled' to 'http' to 'file' to 'vscode-resource' (this one should be used by Webview to restrict access to only certain files/paths).The above fix explicitly parses path using a file schema.
The best documentation I found on this was reading comments in the
vscode.d.tsfile.