-
Notifications
You must be signed in to change notification settings - Fork 22
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
Support testing of the file system API with Web Extension #22
Comments
It's currently not possible. I think what missing is the capability to open on an empty workspace so that local file folders can be added. |
Thanks @aeschli . This may not be limited to vscode-test-web as I was unable to test the same using I wonder, how is this tested/developed by the vscode team?
Happy to help depending on how large this task is |
I've been able to work around this issue by forcing the scheme of any URIs used in my extension to be e.g. let uri = vscode.Uri.file(path);
if (VSCODE_TEST_WEB) {
// Use vscode-test-web fs-provider
uri = uri.with({ scheme: 'vscode-test-web', authority: 'mount', path: `/${uri.authority}` });
} Perhaps a fix is to rewrite any URIs in the test extension on the fly? |
@thegecko If all you need is to access some local files for testing reasons, then you can use the |
Thanks @aeschli
Yeah, that was the approach I had. I think the bug here is that web extensions fail to be able to read any files using
I wonder if that can be done here, with a redirection to the |
@thegecko When you start That matches what we have in vscode.dev and allows you to test things manually. Now the question is, how can this be used in a automated test. I don't know the answer to this. I think there's no way around the dialog. |
Thanks @aeschli , I was specifying a folder directly on the cli, I'll try this new approach... |
Confirmed to be working as described. 👍 |
@thegecko Hello, I'm developping an web-extension that uses vscode.workspace.fs.writeFile, and i'm getting "Error: No file system handle registered" when running as a web-extension (either running with vscode-test-web, in local brownser, or on vscode.dev ) I cant seem to be able to use vscode.workspace.fs.writeFile when my extension is running in a browser. So i was just wondering: Do you have an extension written or some example somewhere that i could look at, at to see an example of using vscode.Uri properly to make valid URI's to be able to 'writeFile' when running as a web-extension ? Thanks! :D edit: typo |
I'm developing a Web Extension which needs access to the filesystem.
As outlined in the docs, I'm using the
vscode.workspace.fs.*
commands along withvscode.Uri
paths.I'm testing this locally with a vscode build from
main
and runningvscode-test-web
, e.g.:However accessing any files throws the error:
As thrown here
I've tried:
code-web.sh
andcode-server.sh --launch
) and installing my extensionAnd all of the above fail on a locally built vscode.
The
vscode-mock-debug
extension works as expected in https://vscode.dev, but I can't test there as I require some modifications in the vscode source.How can file system APIs be tested from a web extension in a local build of vscode?
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
The text was updated successfully, but these errors were encountered: