bazelbuild / intellij

IntelliJ plugin for Bazel projects
https://ij.bazel.build/
Apache License 2.0
761 stars 303 forks source link

feat: create "Add package" EditorNotificationPanel if derive_targets_from_directories is on #6388

Closed tpasternak closed 4 months ago

tpasternak commented 4 months ago

Based on #6359 by @dkashyn-sfdc

Checklist

Please note that the maintainers will not be reviewing this change until all checkboxes are ticked. See the Contributions section in the README for more details.

Discussion thread for this change

Issue number: <please reference the issue number or url here>

Description of this change

tpasternak commented 4 months ago

The code contains some code duplications, but otherwise it would require either to put some if statements in the middle of the bodies, or to rework the whole file, which we would like to avoid @ujohnny @LeFrosch

ujohnny commented 4 months ago

So initially there was a notification

Do you want to add this file to your project sources?           Add file to project

And with this change it in some cases looks like

Do you want to add this file to your project sources?           Add package to project

I'd consider updating notification text for the new action into something like

Do you want to add this package to your project sources?  Add package to project

Also I checked the code on a basic example with directories: . and click on the notification does not do anything. I guess this has to be checked before displaying the notification

Screencast from 2024-04-18 16-33-45.webm