-
Notifications
You must be signed in to change notification settings - Fork 276
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
Make intellij plugin aware of proto source dirs #193
Conversation
Need to verify that protobuf plugin failing will not impede intellij from opening the project. I need the idea task to run after the protobuf plugin, but it doesn't actually need the plugin to succeed. |
@zhangkun83 PTAL This PR modifies the configuration step of the GenerateProtoTask so that all known proto directories are added to intellij's sourceDir/testSourceDir sets. Because this is the configuration step, we know the proto dirs are registered before the idea task is run, and that the actual success of GenerateProtoTask is irrelevant. There is a slight gotcha that the idea plugin will silently ignore directories that do not exist. The workaround is to create the directories right before the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except for a minor comment.
f.mkdirs() | ||
} | ||
} | ||
} catch (UnknownDomainObjectException e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this thrown from getByType()
? Since this method is called without checking the presence of the IDEA plugin, this is considered a normal control flow, and exceptions should not be used for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like findByType the non throwing version that I didn't know existed. Updating PR.
5ca8ecc
to
524f010
Compare
e6b45d6
to
c5dfda8
Compare
Verified that with this change, the intellij proto plugin no longer complains about
import
targets being not found. Jump to definition works as expected in.proto
files.Fixes #156