jvolkman / intellij-protobuf-editor

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

Issues navigating to protos defined nested in source #68

Closed mxr closed 2 years ago

mxr commented 2 years ago

My project has Go application code, proto files, and generated Go code in the same repo. I'm using GoLand

When I configure import paths automatically, navigating from the usage of a generated object to its definition works as expected, but navigating inside proto files doesn't. Parent/sibling/etc proto dependencies cannot be resolved. (Example: When I open try to find the Go definition of foo.Foo, the editor takes me to foo.pb.go, and navigating within foo.proto to other files is broken)

When I configure import paths manually, navigating from the usage of a generated object to its definition instead takes me into the proto file. And navigating across proto files work. (Example: When I try to find the Go definition of foo.Foo, the editor takes me to foo.proto not foo.pb.go, and navigating within foo.proto works)

What I am trying to accomplish is both: navigating from the usage of foo.Foo to its definition takes me to foo.pb.go and navigating within foo.proto into other proto files works.

I cannot enable the proto directory as a root since it is nested under the project root already.

The only way I have solved this is by creating a brand new GoLand project with the root directory as the proto folder, but I would prefer to do everything in one Go project if possible.

jvolkman commented 2 years ago

First, note that this is no longer the best place for such reports. JetBrains has taken over maintenance of this plugin (it ships by default with newer versions of their products). Bug reports/questions are better served by their own bug tracker.

That said, it sounds like what you're looking for is "go to implementation" instead of "go to declaration". You can go to a symbol's implementation by holding ctrl+alt when you click on it.

mxr commented 2 years ago

Thanks for the bug report tip and the pointer about "go to X." I typically use "go to Declaration or Usages" and to ensure that I don't jump into proto code unexpectedly, looks like I have to use "go to Type Declaration"