Skip to content
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

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

Merged
merged 7 commits into from
Apr 22, 2024

Conversation

tpasternak
Copy link
Collaborator

@tpasternak tpasternak commented Apr 11, 2024

Based on #6359 by @dkashyn-sfdc

Checklist

  • I have filed an issue about this change and discussed potential changes with the maintainers.
  • I have received the approval from the maintainers to make this change.
  • This is not a stylistic, refactoring, or cleanup change.

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

@github-actions github-actions bot added product: CLion CLion plugin product: IntelliJ IntelliJ plugin product: GoLand GoLand plugin awaiting-review Awaiting review from Bazel team on PRs labels Apr 11, 2024
@tpasternak
Copy link
Collaborator Author

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

@tpasternak tpasternak requested review from ujohnny and LeFrosch and removed request for jastice, agluszak and mai93 April 11, 2024 14:27
@tpasternak tpasternak changed the title Add package feat: create "Add package" EditorNotificationPanel if derive_targets_from_directories is on Apr 11, 2024
@ujohnny
Copy link
Collaborator

ujohnny commented Apr 18, 2024

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

edit.apply();
// TODO(brendandouglas): support partially syncing a directory with the same query-based
// filtering
List<? extends TargetExpression> targetsToSync = targets;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is always null

return null;
}
EditorNotificationPanel panel =
createPanel(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me that some regions have formatting issues. I believe the indent should be 4 spaces instead of 8.

@tpasternak tpasternak requested a review from ujohnny April 18, 2024 15:03
Copy link
Collaborator

@ujohnny ujohnny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, but agreed to extract duplicated constant to variable in a separate PR

@tpasternak tpasternak merged commit 5d1c03c into bazelbuild:master Apr 22, 2024
6 checks passed
@tpasternak tpasternak deleted the add-package branch April 22, 2024 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product: CLion CLion plugin product: GoLand GoLand plugin product: IntelliJ IntelliJ plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants