Browsing zip content - any work already done?


#1

I’m about to look into implementing source browsing in dependency jars (java archive zip files) for Scala and Java. We’re using URL:s looking like this:

/Users/viktor/.coursier/cache/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.11.8/scala-library-2.11.8-sources.jar!/scala/collection/immutable/List.scala

Which means the file /scala/collection/immutable/List.scala inside the zip file /Users/viktor/.coursier/cache/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.11.8/scala-library-2.11.8-sources.jar

So, my current idea is to use the API point: https://atom.io/docs/api/v1.12.0/Workspace#instance-addOpener

to add something that opens up the zip archive maybe to a temp area or maybe reading directly depending on what I find in node land. And then extend TextEditor with a read only buffer with the content. Something like that is the best I’ve come up with.

Now I just wonder - is there anything already done in this area that I can use or look into? Couldn’t really find any package when searching that seemed to do this, but I don’t want to re-invent anything. And does my approach seem reasonable?


#2

Have you taken a look at the built-in archive-view package?


#3

Thanks! How I couldn’t find that one amazes me :blush: