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

Workspace Trust API to support newer VS Code Git plugins #10472

Closed
martin-fleck-at opened this issue Nov 26, 2021 · 1 comment
Closed

Workspace Trust API to support newer VS Code Git plugins #10472

martin-fleck-at opened this issue Nov 26, 2021 · 1 comment
Labels
vscode issues related to VSCode compatibility

Comments

@martin-fleck-at
Copy link
Contributor

When creating an electron application with the latest VS Code built-in Git plugins:

  "theiaPlugins": {
    "vscode-builtin-git": "https://open-vsx.org/api/vscode/git/1.62.3/file/vscode.git-1.62.3.vsix",
    "vscode-builtin-github": "https://open-vsx.org/api/vscode/github/1.62.3/file/vscode.github-1.62.3.vsix",
    "vscode-builtin-github-authentication": "https://open-vsx.org/api/vscode/github-authentication/1.62.3/file/vscode.github-authentication-1.62.3.vsix",
    ...
  }

I get the following error while trying to add a remote repository with Source Control View > Remote > Add Remote...:

git_repositories

I believe the reason for that is that the Git plugin uses some API that Theia does not provide: Trusted workspace API:

// Don't allow auto-fetch in untrusted workspaces
if (workspace.isTrusted) {
   this.disposables.push(new AutoFetcher(this, globalState));
} else {
   const trustDisposable = workspace.onDidGrantWorkspaceTrust(() => {
      trustDisposable.dispose();
      this.disposables.push(new AutoFetcher(this, globalState));
   });
   this.disposables.push(trustDisposable);
}

https://github.com/microsoft/vscode/blob/bfad20be9d75fa83c1d3e31fb6aefbca71aeaddc/extensions/git/src/repository.ts#L942

From what I can see, the isTrusted is false and the onDidGrantWorkspaceTrust does not exist causing the error.

Feature Description:

Implement (a very light-weight version of) the Workspace Trust API:

  • At least provide the isTrusted flag to plugins
  • Support the onDidGrantWorkspaceTrust event to which plugins might be registered
  • Add a dialog to query the user about workspace trust to fire the event based on the users answer

The full functionality is described in https://code.visualstudio.com/docs/editor/workspace-trust

@vince-fugnitto vince-fugnitto added the vscode issues related to VSCode compatibility label Nov 26, 2021
@marcdumais-work
Copy link
Contributor

This should work now, thanks to #10473

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

No branches or pull requests

3 participants