intellij-protobuf-editor icon indicating copy to clipboard operation
intellij-protobuf-editor copied to clipboard

Adding Import paths using Jar File

Open cheatmenot opened this issue 3 years ago • 2 comments

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.

cheatmenot avatar Apr 09 '21 18:04 cheatmenot

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.

devkanro avatar Apr 12 '21 13:04 devkanro

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.

jvolkman avatar Apr 12 '21 16:04 jvolkman