-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IntelliJ doesn't pick up proto annotations dependency #383
Comments
Related upstream issue in protobuf editor plugin: jvolkman/intellij-protobuf-editor#30 |
Issue now in the IntelliJ tracker rather than that repo: https://youtrack.jetbrains.com/issue/IDEA-280610 |
Even the generated sources directories are not always picked up correctly. |
Splitted out the source directories to a separate task as it is not quite the same. Not entirely sure we can do anything here, would need a fix/change in the IntelliJ protobuf plugin. |
Some hint came in on this: The only way I could see to get Intellij to recognize the proto files is by using the Path Settings. This works well for proto files included in the project, but it didn't seem to work when proto files were provided in a jar as a dependency. Such as with the Kalix protocol. You'll notice by default when you open the path settings, there'll be some references/entries to the projects src, and the last entry is for the default provided google proto files located in the following location, at least for mac.. /Users/username/Library/Caches/JetBrains/IntelliJIdea2022.1/protoeditor This basically resolved the editor not being able to pick up the dependencies, however even without that, the project would still build and compile without issue. So this little hack just helps the editor find the right dependencies. I tried different variations of trying to directly reference the jar in the path settings for the protobuf plugin, but nothing else seemed to work. So manually copying the proto files to the protoeditor directory seemed to work. |
Trying out the hint in this comment: jvolkman/intellij-protobuf-editor#64 (comment) adding a random directory, then editing the path in the IntelliJ protobuf path list to be |
Tried out the third party Protobuf plugin from https://github.com/devkanro/intellij-protobuf-plugin/releases/tag/v1.5.20 It seems to work very nicely, picking up the right messages and annotations from jar dependencies both in a sample maven project and a sample scala/sbt project. Installing it requires disabling the default plugins for Protobuf and gRPC shipped with IntelliJ first, so that is a bit cumbersome. |
Since I forgot this already once: Note that this does work as expected for the Scala SDK already, only the Java SDK with maven has the problem. |
Importing and build a fresh project from the maven archetype in IntelliJ (v 212.4746.92 with bundled protobuf
plugin version) still marks the protobuf dependencies as unknown/red. Is there something we are missing doing or is it a shortcoming of the protobuf plugin (seems like plugin docs says you need to add non source protobuf paths manually https://github.com/jvolkman/intellij-protobuf-editor#path-settings)?
The text was updated successfully, but these errors were encountered: