Use `vscode-vfs` (instead of `gitlab-web-ide`) as Web IDE file system scheme
Description
Identified in this thread:
Update the Web IDE file scheme to
vscode-vfs(fromgitlab-web-ide). It looks like this is a hardcoded scheme in a number of VSCode logic (and even extensions). Without this, we're tripping onisTrustedVirtualResourcealways being true so the Web IDE context will always be trusted.
VSCode has some built-in logic which suggests that the main virtual file system used in the browser should be vscode-vfs. This blocks us from using enableWorkspaceTrust: true (see thread for more details
Acceptance Criteria
-
We've added a reference to vscode-vfsin thegitlab-vscode-extensionproject (see investigation notes)- Please make sure that it's safe to do this cross-project renaming across releases. We might need to do a two-step rename (one MR to add
vscode-vfs, then release, then update everything, then removegitlab-web-ide)
- Please make sure that it's safe to do this cross-project renaming across releases. We might need to do a two-step rename (one MR to add
-
We've replaced references to gitlab-web-idefile system withvscode-vfs(see investigation notes) -
We've tested and investigated enough to ensure that this change won't cause any issues...
Investigation notes
- There's a bit of references in the
gitlab-web-ideproject to this file system name:- In
vscode-bootstrapwe'll reference this as the "workspace" url https://gitlab.com/gitlab-org/gitlab-web-ide/-/blob/62d13a6d6c5ed664e06959e25060cf2de9c93a82/packages/vscode-bootstrap/src/start.ts#L293 - In
vscode-extension-web-idethis is referenced in thevscode.package.jsonand in theconstants.ts. - There might be other references... Searching through all
gitlab-web-idewould be a good start. Unfortunately, we use this string a lot.
- In
- There's also references in the
vscode-extensionto this file scheme:- https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/blob/d5a2f0d13fe68352443bd7b0240bea181b723f33/src/common/code_suggestions/code_suggestions.ts#L54
- https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/blob/d5a2f0d13fe68352443bd7b0240bea181b723f33/src/common/language_server/register_language_server.ts#L40
Why doesn't the Web IDE use file: as the FS scheme?
I think the decision to avoid file: was made our of an abundance of caution. It's not clear how VSCode will interpret it's environment if this file scheme is present. Also, github.dev doesn't do this.
These concerns might be unfounded, but it would take some investigation to ensure the this is safe.