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

[Case Study] VSCode + Zip support #1157

Open
arcanis opened this issue Apr 3, 2020 · 3 comments
Open

[Case Study] VSCode + Zip support #1157

arcanis opened this issue Apr 3, 2020 · 3 comments
Assignees
Labels
case study Package compatibility report help wanted Extra attention is needed

Comments

@arcanis
Copy link
Member

arcanis commented Apr 3, 2020

What package is covered by this investigations?

VSCode

Describe the goal of the investigation

Pressing Command+Click on a symbol coming from a packed archive yields an error, because VSCode doesn't know how to access the files from the zip archive.

Investigation report

  • We've written a Zip extension for VSCode that's stored within our repository. It adds support for the zip:// protocol, which looks for a zip archive in the associated path and opens an arbitrary file it contains.

  • @cspotcode wrote a TSServer indirection that makes sure the TypeScript server adds the zip:// prefix to everything it sends to VSCode. In theory it means VSCode would open the file using the Zip extension we provided (or would keep generating the same error if the extension isn't installed).

  • The problem is that there's a tiny code in VSCode that hardcodes a list of accepted protocols. In order to open it to other ones, they wish to see comprehensive testing.

Followup

We need somehow to take ownership of this task (I'm swamped myself, and despite the high priority of this particular task there are a bunch that require more expertise and that I need to address first). To make it easier, I've tried to devise a plan you can follow:

  • The step zero is to publish the VSCode zip extension into the Microsoft store. I'll do that.

  • The first step is to land the server indirection (make sure you're logged into the TS Discord server) into the SDK. @cspotcode, could you help us with that?

  • The next step is to clone the VSCode repository and apply the fix I've suggested.

I've checked into the repository a vscode-zip-test-procedure.sh file. Executing it will setup various repositories and ask to make various confirmations.

  • The third step is to make the existing test procedure pass, and expand the tests to cover more scenarios (see the more described here).
@arcanis arcanis added help wanted Extra attention is needed case study Package compatibility report labels Apr 3, 2020
@arcanis arcanis self-assigned this Apr 3, 2020
@arcanis
Copy link
Member Author

arcanis commented Apr 3, 2020

The Zip extension is published on the marketplace: https://marketplace.visualstudio.com/items?itemName=arcanis.vscode-zipfs

It's still experimental but the core is there. VSCode will be able to open absolute zip paths if prefixed by zip: (no extra slashes). For example, try pasting the following into a buffer, then command-click it:

zip:/<path to the berry repository on your machine>/.yarn/cache/left-pad-npm-1.3.0-0382e69409-2.zip/node_modules/left-pad/package.json

@cspotcode
Copy link

For what it's worth, it may be possible to patch the typescript language features extension, share as a VSIX, and install it in vanilla VSCode installations. It might allow ambitious yarn 2 users to try out the functionality for themselves and see what breaks.

@BasixKOR
Copy link
Contributor

It seems like this has been fixed by upstream (VS Code): microsoft/vscode#94986

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
case study Package compatibility report help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@cspotcode @arcanis @BasixKOR and others