Closed akhan-vertiv closed 4 years ago
These options come from the file google/protobuf/descriptor.proto
which must be in the protobuf import paths. The plugin ships with a copy of this file that it adds by default to the import path (see the third item in the image below). If you configured the paths yourself, you may have inadvertently removed it. But you don't need to use the copy that ships with the plugin. If you have the protobuf compiler installed you can add its location to your import path as well.
Yup you are right. I did inadvertently remove that path. Putting that back in solved the problem. Thank you!!
Hi there, I'm having the same issue:
And I have the plugin settings set to automatic:
When I untick the automatic setting, the descriptor path turns red:
So this to me looks like it can't find the descriptor file bundled with the plugin.
@Raqbit I would expect the built-in to be listed when "configure automatically" is selected. Can you open a new issue and also include what editor you're using?
Please kindly reopen this!
After upgrading from 2021.1 to 2021.2, this issue appeared for me even though my settings are correct.
here is how my both my setting and the error look like:
For me, it helped to uncheck the "Configure automatically" and remove "google/protobuf/" from the default Descriptor Path. Was: google/protobuf/descriptor.proto Now: descriptor.proto
FYI: JetBrains actually maintains and releases this plugin now (see the README on the front page). They're bundling it with certain products, and the latest versions in the marketplace are built by them. The main repository is over at https://github.com/JetBrains/intellij-plugins/tree/master/protobuf now.
For me, it helped to uncheck the "Configure automatically" and remove "google/protobuf/" from the default Descriptor Path. Was: google/protobuf/descriptor.proto Now: descriptor.proto
This one didn't work for me unfortunately.
FYI: JetBrains actually maintains and releases this plugin now (see the README on the front page). They're bundling it with certain products, and the latest versions in the marketplace are built by them. The main repository is over at https://github.com/JetBrains/intellij-plugins/tree/master/protobuf now.
I already have this plugin installed.
I already have this plugin installed.
If you're using 2021.2, you're using the plugin from the JetBrains repo. They took over the Marketplace entry. The version in this repository was never updated to support 2021.2.
yes https://github.com/jvolkman/intellij-protobuf-editor/issues/33#issuecomment-889904619
I also encountered this problem after upgrading After upgrading from 2021.1 to 2021.2, this issue appeared for me even though my settings are correct.
here is how my both my setting and the error look like: https://github.com/jvolkman/intellij-protobuf-editor/issues/33#issuecomment-889671163
If you modify the import path and replace GoLand2021.2
with GoLand2021.1
, it would probably work.
Eventually, your default import path would look like: jar:///Users/$(whoami)/Library/Application Support/JetBrains/GoLand2021.1/plugins/protobuf-editor.jar!/include
Or you can just delete the default import path, clone the protocolbuffers/protobuf
, add protocolbuffers/protobuf/src
to as your import path, it could definitely solve this prolem.
It looks like JetBrains is fixing this issue. See https://youtrack.jetbrains.com/issue/IDEA-274732 and https://github.com/JetBrains/intellij-plugins/commit/4845bf0741fd6dc530cb6ec95a9c4b650986cae4
For me, it helped to uncheck the "Configure automatically" and remove "google/protobuf/" from the default Descriptor Path. Was: google/protobuf/descriptor.proto Now: descriptor.proto
This solved my issue for intellij latest version as of aug 2021
In the meantime before this is fixed by JetBrains, a fix was pointed out by Veniamin Albaev in IDEA-274732 - you should uncheck "Configure automatically" and set the prefix google/protobuf
for the default location. This approach also makes sure that files importing google/protobuf/descriptor.proto
are linted correctly (e.g. files that define custom file or field options).
I don't understand why this is closed if this has not been fixed
I don't understand why this is closed if this has not been fixed
Well, two reasons: 1) this issue wasn't originally related to the recent JetBrains breakage; people simply started commenting on it 1 year after it had already been closed. 2) JetBrains took over this plugin and all future development and issue tracking has moved over to their sites (see the marketplace page for links)
this will be resolved by just mentioning the import as import "protoname.proto" if its in the same package, else mention package. and at the time of using this imported proto in new proto file, mention the package name for example-
message{ com.package.sources.protoname name = 1; }
These options come from the file
google/protobuf/descriptor.proto
which must be in the protobuf import paths. The plugin ships with a copy of this file that it adds by default to the import path (see the third item in the image below). If you configured the paths yourself, you may have inadvertently removed it. But you don't need to use the copy that ships with the plugin. If you have the protobuf compiler installed you can add its location to your import path as well.
yeah. this method can help us solve the compile problem and after I do this, the red lines dispeared!
Happily, I now choose another plug-in to solve this problem, although it doesn't pay as much attention as proto buffer.
With this plug-in [Protobuf Support], you can solve: Cannot resolve option 'go_package'
Other reference proto files can also be automatically identified.
The text go_package in the line appears in red in the editor. Previously it did not. Not sure when it started happening. I am using 2.1 version.
When I hover over, I see the text: Cannot resolve option 'go_package' how can I resolve?