nnmatveev / idea-plugin-protobuf

Google Protocol Buffes support for Intellij IDEA
Other
120 stars 39 forks source link

How is this supposed to work? #89

Closed jesscarter closed 8 years ago

jesscarter commented 8 years ago

Right-clicking on a .proto and selecting compile does nothing. Right-clicking on a module and selecting Make Module does not build the protos. Is there some other way I'm supposed to get this to work? I set up a Protobuf Facet in my project settings.

tcripps commented 8 years ago

Jess,

The plugin should work when you compile the module or the project (though not on individual files ATM). Did you set up the path to the protoc compiler in your IDEA settings? Are there any messages in the event log?

Travis

On May 2, 2016, at 10:30 AM, Jess Carter notifications@github.com wrote:

Right-clicking on a .proto and selecting compile does nothing. Right-clicking on a module and selecting Make Module does not build the protos. Is there some other way I'm supposed to get this to work? I set up a Protobuf Facet in my project settings.

As far as I can tell, this plugin is completely nonfunctional. Is this still maintained?

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub

jesscarter commented 8 years ago

I figured out what was going on. Apparently on Mac, Intellij plugins run with weird PATH settings.

The log contained reasonable output and no error messages were displayed. 2016-05-02 14:46:33,388 [3277842] INFO - protobuf.compiler.PbCompiler - Invoking protoc: protoc --proto_path=/Users/jcarter/IdeaProjects/untitled/src/com/company --proto_path= --proto_path= --java_out=/Users/jcarter/IdeaProjects/untitled/src /Users/jcarter/IdeaProjects/untitled/src/com/company/test.proto

Copypasting that command into a shell generated the java files. There was no indication of any error in the logs or UI. I tried downloading the plugin source and running it through Intellij's plugin debugger. Weirdly, it worked while debugging but failed silently when I tried running the actual plugin. After a lot of confusion, I discovered that Intellij messes with the PATH variable when the plugin is run in non-debug mode. I replaced my "protoc" symlink with a full path in the compiler settings and everything works now.

Sorry for the false alarm! I spent days being frustrated by this.

BTW compiling individual files works!