jvolkman / intellij-protobuf-editor

Protocol Buffers for IntelliJ-based IDEs
Apache License 2.0
122 stars 15 forks source link

Adding Import paths using Jar File #64

Open cheatmenot opened 3 years ago

cheatmenot commented 3 years ago

I have read the readme about adding import paths for the missing proto, but this time I would like to add an import path using a jar file, in my case the proto is in that jar file and it is very troublesome for me to cherry-pick and copy those files one by one.

devkanro commented 3 years ago

I have created a PR(#29) for this feature, but the author said he will refactor the file resolver, but there are no updates after many months.

So I built a new plugin for improving development experience with protobuf for Java Project.

jvolkman commented 3 years ago

If it's just a single jar file, you can use this workaround currently:

  1. Add any path to the list of include paths
  2. Double click on that new path (or highlight it and click the edit button) and replace the entire URL including file:// with something like: jar:///path/to/my.jar!/path/in/jar

This is a built-in scheme supported by IntelliJ's virtual filesystem, and is used by the plugin already to include built-in files (e.g., descriptor.proto). The exclamation point marks the start of the path to search within the jar file.