Keyboard short-cut to open classes by name
When I use the "Navigate/ Class" feature, I often want to open more than one match. Is there a keyboard short-cut to do that?
Shift+Click works but splits in new vertical panes (not ideal when opening several files). Alt+Click and Ctrl+Click work… randomly. Sometimes they open all selected classes, sometimes the only open the first one (and I can't figure out the logic).
Please sign in to leave a comment.
Hi Alvaro,
Do you release the Shift button before pressing Enter in this case?
In general, no specific shortcut is required here. Just open the Navigate | Class dialog with Cmd+O (macOS) or Ctrl+N (Windows/Linux), start typing the pattern, select multiple files in the search results (use Shift for that), release the Shift button, and hit only Enter to open all selected classes.
Hitting only Enter works inconsistently. Some times it opens all selected classes in tabs, sometimes it only opens one.
If that's the expected way to do it, then I suspect it's clashing with the feature (I don't know how it's called) that allows you to quickly browse files, because there's a flash of files being opened in the same tab and only the last one remains, with its name in italics:
Yes, this is the expected way to do it.
However, the Navigate action should open files in the regular mode, not in the preview one. This works with and without the Enable Preview Tab option enabled.
I was not able to reproduce the reported behavior. Is there any pattern in when it happens? Perhaps there are certain steps that lead to this.
The only pattern I can see is that it works on second attempt.
Also, disabling “Enable preview tab” appears to solve the issue.
Anastasiia Zyrianova
While we're at it:
I expected the same behaviour in DataGrip for opening multiple tables, but alas: selecting multiple files (either by using Shift or Control) does not work and only one table gets opened.
Is it a known issue for DataGrip?
---
Latest version of DataGrip 2024.1.4
macOS Sonoma 14.5
Hi Levan,
I believe you're referring to Search Everywhere where you want to select multiple tables based on a pattern and open them in a separate tabs. If so, it does allow selecting multiple objects by holding Shift and opening them by pressing Enter
Hi, Aleksandr.
I was also expecting the same, but whatever I do - I cannot do that: only the first row (in your case it would be `table_bin`) gets opened, I don't know why.
I also performed the following actions hoping they'll help with this issue, but the didn't:
---
For example in IntelliJ IDEA I can open multiple classes like that, but in DataGrip - that is not the case for some reason.
Увы.
Thanks for the update, Levan.
I've just tried this scenario by selecting tables with a name prefix from a search drop-down and hitting enter. All highlighted tables were opened at once in PHP Storm 2024.1.X versions. May I know what is your current IDE version?
Hi, Aleksandr.
As I mentioned in my first post above:
And yes, it is 👉 DataGrip and not PhpStorm.
UPDATE
Seems this issue is now resolved! 🎉
When opening a database, which is formally defined as “Go To Database Object”:
and searching for the desired results, I can now select multiple items and then just click "Enter" and they will be all opened each in a separate tab.
Tested on the latest (at the time of writing this) version of DataGrip:
✅ So now everything is OK!