Builtin support for reading files from their zip archives
See original GitHub issueRel: #17271
Note: This is now possible (although non-builtin) using the ZipFS extension
High-level
It would be useful for VSCode to be able to read files even when they’re stored within zip archives. Opening /foo/bar.zip/package.json
would succeed. Read-only is likely fine, at least for a first iteration.
Motivation
-
This feature isn’t unheard of. Both vim and emacs support reading files from zip archives (they even go a bit farther by allowing to also edit them, but we might not want to have to deal with the UI complexity for now).
-
Package managers are experimenting with virtual install folders. Being able to read third-party files from the archives that contain them will be important to provide a good developer experience (particularly for the “ctrl+click on a symbol to go to its definition” workflow). Zip will be used by Yarn because of its good random access properties.
Suggested Implementation
-
The Yarn project ships a wasm build of the libzip as an external package. This would make it easy to use a battle-tested zip library at little cost.
-
The size cost would be around ~300KB for the Zip implementation (which could be reused for other purposes - there’s a bunch of things that could use Zip support down the road).
-
You might actually already have a library able to do that?
Why not an extension
- I’ve started working on an extension to help with that (vscode-zipfs), but it cannot be integrated as well as I’d like. In particular, it doesn’t work with the ctrl+click workflow I mentionned, and running
code /foo/bar.zip/package.json
cannot open the right file. I believe a builtin integration could provide a seamless integration, which would be beneficial to the users.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:735
- Comments:35 (4 by maintainers)
Top GitHub Comments
🙂 This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.
Happy Coding!
This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.
Happy Coding!