-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
PR: Add function/class search shortcut, menu and toolbar entries #3878
Merged
Merged
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e2051bd
Now can invoke symbol finder via Ctrl+Alt+P
andfoy 318a9d3
Minor correction update in default configuration example file
andfoy 57ac0f1
PEP8 style corrections
andfoy e8ae93b
PEP8 style corrections
andfoy c668115
Reset defaults file
andfoy 08ead8e
Merge remote-tracking branch 'upstream/3.x' into symbolfindershort
andfoy 28a20c3
Removed show/hide project explorer shortcut
andfoy 388e7b1
PEP8 style issues corrected
andfoy df9d53e
PEP8 style issues corrected
andfoy 684b3fa
Merge branch '3.x' into symbolfindershort
ccordoba12 dc5e91f
Config: Bump CONF_VERSION because of the removed option
ccordoba12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -651,6 +651,14 @@ def get_plugin_actions(self): | |
self.register_shortcut(self.file_switcher_action, context="_", | ||
name="File switcher", add_sc_to_tip=True) | ||
|
||
self.symbol_finder_action = create_action(self, _('Symbol finder...'), | ||
icon=ima.icon('symbol_find'), | ||
tip=_('Fast symbol search in file'), | ||
triggered=self.call_symbol_finder, | ||
context=Qt.ApplicationShortcut) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not saying you should change this, just a comment for reference. # I tend to favor this one for several reasons.
# It can be automatically performed and enforced by tools like yapf
# it results in more lines of code but ir more readable as each line corresponds
# to a parameter
self.symbol_finder_action = create_action(
self,
_('Symbol finder...'),
icon=ima.icon('symbol_find'),
tip=_('Fast symbol search in file'),
triggered=self.call_symbol_finder,
context=Qt.ApplicationShortcut)
# or
self.symbol_finder_action = create_action(self,
_('Symbol finder...'),
icon=ima.icon('symbol_find'),
tip=_('Fast symbol search in file'),
triggered=self.call_symbol_finder,
context=Qt.ApplicationShortcut) |
||
self.register_shortcut(self.symbol_finder_action, context="_", | ||
name="symbol finder", add_sc_to_tip=True) | ||
|
||
self.revert_action = create_action(self, _("&Revert"), | ||
icon=ima.icon('revert'), tip=_("Revert file from disk"), | ||
triggered=self.revert) | ||
|
@@ -995,6 +1003,7 @@ def get_plugin_actions(self): | |
self.save_all_action, | ||
save_as_action, | ||
self.file_switcher_action, | ||
self.symbol_finder_action, | ||
self.revert_action, | ||
MENU_SEPARATOR, | ||
print_preview_action, | ||
|
@@ -1007,7 +1016,8 @@ def get_plugin_actions(self): | |
self.main.file_menu_actions += file_menu_actions | ||
file_toolbar_actions = [self.new_action, self.open_action, | ||
self.save_action, self.save_all_action, | ||
self.file_switcher_action] | ||
self.file_switcher_action, | ||
self.symbol_finder_action] | ||
self.main.file_toolbar_actions += file_toolbar_actions | ||
|
||
# ---- Find menu/toolbar construction ---- | ||
|
@@ -1725,6 +1735,11 @@ def call_file_switcher(self): | |
if self.editorstacks: | ||
self.get_current_editorstack().open_fileswitcher_dlg() | ||
|
||
@Slot() | ||
def call_symbol_finder(self): | ||
if self.editorstacks: | ||
self.get_current_editorstack().open_symbolfinder_dlg() | ||
|
||
def update_recent_file_menu(self): | ||
"""Update recent file menu""" | ||
recent_files = [] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think this shortcut is no more needed because
@goanpeca, what do you think?
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.
Agreed!
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.
Ok, then @andfoy please remove this shortcut as part of this PR.
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 don't mind that much about the shortcut, but I don't expect the Project explorer to be visible all the time. I actually close the Project explorer when working on my laptop because the screen is not big enough, and I find it pretty annoying that it always comes back when I launch Spyder. Even on my desktop screen, which is big enough, I don't find the Project explorer particularly useful - I only use it when opening files.
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.
Well, the Project Explorer can be closed at any time, so it's not enforced on users. It's just a visual clue that you're working on a project.
Please submit a PR to fix that. I don't have a problem with it :-)