Skip to content
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

Can not open files in WSL2 sessions #21

Closed
zobbo opened this issue Jun 6, 2022 · 1 comment · Fixed by #22
Closed

Can not open files in WSL2 sessions #21

zobbo opened this issue Jun 6, 2022 · 1 comment · Fixed by #22

Comments

@zobbo
Copy link

zobbo commented Jun 6, 2022

When connected to a WSL2 issue I can browse directories but trying to open a file gives me

[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")

I need this extension so badly, I'm half tempted to try and learn how to code visual studio extensions :). Many thanks for what you've done so far!

VSC 1.67.2 running on Windows 11, accessing WSL2

@jrun
Copy link

jrun commented Oct 29, 2022

I don't know much about vscode extensions and I don't have time to work up a PR. That said, I was able to hack fileitem.js to fix this issue for me. It seems vscode.Uri.file should be used instead of Uri.parse when working with a path to a file. YMMV.

 get uri() {
        const p = path.join(this._dirname, this._filename);
        if (this._isDirectory) {
            return vscode.Uri.parse(`${provider_1.default.scheme}://${p}`);
        }
        else if (this._isFile) {
            return vscode.Uri.file(p);
        }
        return undefined;
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants