-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Add option to exclude addons in Quick Open dialog #47563
Conversation
editor/quick_open.cpp
Outdated
} | ||
} | ||
|
||
void EditorQuickOpen::_theme_changed() { | ||
search_box->set_right_icon(search_options->get_theme_icon("Search", "EditorIcons")); | ||
} | ||
|
||
void EditorQuickOpen::_save_exclude_addons() { |
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.
Why is this a project setting but also a checkbox in the dialog? I am against introducing checkboxes to Quick Open dialogs, but a project setting could be fine. That would allow this filter to be done just once when opening the dialog in _build_search_cache
.
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.
Imagine the user doesn't want to see addon files in his/her current project. But there came a time when s/he needs to search for a file from addons (for whatever reason). S/he opens project settings, find the setting, clicks it, opens the Quick Open dialog, finds the file s/he needs, opens the project settings again, finds the setting and clicks it again.
Unless there's a checkbox for than in Quick Open dialog that simplifies that process a lot. Which is the reason i've added it.
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.
I agree, it makes sense to expose this in a checkbox in the Quick Open dialogs. Its value should persist across restarts.
However, I'd store this in the editor settings rather than the project settings. You most likely don't want to commit that setting to version control whenever it changes 🙂
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.
I made it a project setting since the user might have some project when s/he doesn't want to see addons' files and some projects (like addons s/he's developing) where s/he does. But if editor settings is a better place for that, sure, i can change.
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.
@hilfazer I don't imagine Quick Open is the first thing they will use to find it, I imagine they will just use the filesystem dock. But even this unlikely scenario you describe doesn't sound unreasonable. It's certainly preferable over introducing edge case checkboxes in every place, especially Quick Open dialogs. Unnecessary elements like this are a distraction that go against its purpose.
81f3ded
to
98d6c89
Compare
I've replaced project setting with an editor setting. I'm not sure if "filesystem/file_dialog/quick_open_exclude_addons" is a right way to name it so i'm asking for some guidance here. Hinlopen made a good point about using the filesystem dock so i've removed the checkbox. |
98d6c89
to
afdb664
Compare
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.
Tested locally (rebased against master
in https://github.com/Calinou/godot/tree/quick_open_exclude_addons_40), it works as expected.
Setting disabled (default)
Setting enabled
Code looks good to me.
I feel like this option is a bit too specific. Are we going to add a new boolean for each case where we may want to exclude the addons folder? And the other way around, what if there is a use case for ignoring more folders for "Quick Open"? |
In case there should be a list of folders to ignore should it still be an editor setting or rather a project setting? While addons/ is universal across all projects the others folders a user might want to ignore will/can differ from project to project. |
078b4fd
to
f5d3b25
Compare
I think this kind of filter should be toggled directly in the Quick Open dialog, and not in editor settings. So if we think we only want to support excluding results from If we want to support more arbitrary exclude filters, then we could add a way to hide folders with a right click tooltip, and add a button to toggle showing hidden folders. |
There are already requests to exclude addons from other places as well, e.g. godotengine/godot-proposals#7392 for the FileSystem dock filter. Which is why I'm raising my concern. A project setting with comma-separated wildcards makes sense to me. |
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.
Some minor details, looks good otherwise
9682a88
to
0e0c6e6
Compare
736f3f6
to
a0a00df
Compare
Also needs a rebase against the most recent version, it has conflicts |
a0a00df
to
4d2cfe3
Compare
Why not to just allow to exclude folders right-clicking them? Something like that in context menu:
This might be scalable and also you can stay in context and show the states directly on the folder |
This is excactly what I also had in mind, because that is how it works in other IDEs (e.g. IntelliJ Idea). I would also add an option to exclude from "Find in Files" since i think it would also greatly benefit from this change. |
I added a salvageable tag because there seems to be interest in having this feature. |
Superseded by #56772. Thanks for the contribution! |
One of the features requested in godotengine/godot-proposals#25.
A video with the feature working in 3.3:
Godot_exclude_addons.mp4