jvolkman / intellij-protobuf-editor

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

doc on “Navigating between protobuf files and some other languages (Java, Go, Python)” #27

Closed unship closed 3 years ago

unship commented 4 years ago

how to use this feature "Navigating between protobuf files and some other languages (Java, Go, Python)"

jvolkman commented 4 years ago

When working properly, navigating to a type (e.g., ctrl+click on a name) should bring you to the .proto file instead of the generated source code. It relies on a number of assumptions about location and structure of generated code, though, so I wouldn't be surprised if it doesn't work in all situations. If it can't find the .proto file, you'll just be taken the the generated source.

What language and build system are you using?

unship commented 4 years ago

os: macOS 10.15.5 (19F101) lang: golang 1.14

thanks for quick response, let's take k8s https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/api/admission/v1/generated.proto as an example.

it don't worker as expected.

jvolkman commented 4 years ago

It looks like the generated Go output changed with recent versions of the protobuf compiler, which broke navigation.

jvolkman commented 4 years ago

The other problem is that the example you provided is built with protoc-gen-gogo rather than protoc-gen-go. The output structure is very slightly different.

28 should address both. If you'd like to test, you can find a build artifact at https://github.com/jvolkman/intellij-protobuf-editor/actions/runs/172986275 that you can install manually. Unzip protobuf-editor.zip and install the jar as a plugin.

unship commented 4 years ago

it work as expected, is any method to disable this feature("Navigating between protobuf files and some other languages (Java, Go, Python)") for a moment? some times i just want to explore the pb file

jvolkman commented 4 years ago

@llvim try holding alt when navigating to "Go to implementation". I.e., ctrl+alt+click or cmd+option+click in macos.

jvolkman commented 3 years ago

I think this was fixed.