This repository was archived by the owner on Sep 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Fix for issue #6084: Move Find items to different menu #7488
Merged
Merged
Changes from 3 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
06e9b2a
Add new Search menu
lkcampbell 7317a29
Add 'Find in Selected File/Folder' menu item
lkcampbell 42cd989
Give 'Find in Selected' it's own Command
lkcampbell d298003
Change Search to Find. Replace SEARCH prefix with CMD prefix.
lkcampbell 56ab3e9
Add deprecation code
lkcampbell e337d24
Merge pull request #7544 from adobe/alf_localization
pthiess 12983f6
Merge branch 'fix-6084' of github.com:lkcampbell/brackets into fix-6084
lkcampbell 427c8e9
Fix merge conflict
lkcampbell 7ca5f89
Update Commands deprecation code
lkcampbell 4c633af
Small Code clean up
lkcampbell 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -289,16 +289,6 @@ define({ | |
"CMD_SPLIT_SEL_INTO_LINES" : "Split Selection into Lines", | ||
"CMD_ADD_CUR_TO_NEXT_LINE" : "Add Cursor to Next Line", | ||
"CMD_ADD_CUR_TO_PREV_LINE" : "Add Cursor to Previous Line", | ||
"CMD_FIND" : "Find", | ||
"CMD_FIND_FIELD_PLACEHOLDER" : "Find\u2026", | ||
"CMD_FIND_IN_FILES" : "Find in Files", | ||
"CMD_FIND_IN_SUBTREE" : "Find in\u2026", | ||
"CMD_FIND_NEXT" : "Find Next", | ||
"CMD_FIND_PREVIOUS" : "Find Previous", | ||
"CMD_FIND_ALL_AND_SELECT" : "Find All and Select", | ||
"CMD_ADD_NEXT_MATCH" : "Add Next Match to Selection", | ||
"CMD_SKIP_CURRENT_MATCH" : "Skip and Add Next Match", | ||
"CMD_REPLACE" : "Replace", | ||
"CMD_INDENT" : "Indent", | ||
"CMD_UNINDENT" : "Unindent", | ||
"CMD_DUPLICATE" : "Duplicate", | ||
|
@@ -312,6 +302,20 @@ define({ | |
"CMD_TOGGLE_CLOSE_BRACKETS" : "Auto Close Braces", | ||
"CMD_SHOW_CODE_HINTS" : "Show Code Hints", | ||
|
||
// Search menu commands | ||
"SEARCH_MENU" : "Search", | ||
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. FWIW, a few people on the team expressed a preference for "Find" as the name of the menu, which I think I agree with since most of the menu items start with "Find". /cc @larz0 to see if he agrees. 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. If we remove the |
||
"CMD_FIND" : "Find", | ||
"CMD_FIND_FIELD_PLACEHOLDER" : "Find\u2026", | ||
"CMD_FIND_NEXT" : "Find Next", | ||
"CMD_FIND_PREVIOUS" : "Find Previous", | ||
"CMD_FIND_ALL_AND_SELECT" : "Find All and Select", | ||
"CMD_ADD_NEXT_MATCH" : "Add Next Match to Selection", | ||
"CMD_SKIP_CURRENT_MATCH" : "Skip and Add Next Match", | ||
"CMD_FIND_IN_FILES" : "Find in Files", | ||
"CMD_FIND_IN_SELECTED" : "Find in Selected File/Folder", | ||
"CMD_FIND_IN_SUBTREE" : "Find in\u2026", | ||
"CMD_REPLACE" : "Replace", | ||
|
||
// View menu commands | ||
"VIEW_MENU" : "View", | ||
"CMD_HIDE_SIDEBAR" : "Hide Sidebar", | ||
|
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
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.
Changing the command constants could break extensions. We should search to see if any are using the old ones -- might want to consider keeping them around as deprecated if so.
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.
Fwiw btw, I've never really liked the idea that we're prefixing everything with its menu parent's name. While we're renaming these, maybe we should just strip the prefix off altogether? (On the symbolic constants, not necessarily the underlying string values).
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.
Yup, I'd agree with that - the command names/ids shouldn't really depend on the location of the command/id in the menus (especially since we refer to these from unit tests, etc. - you shouldn't have had to change all that code just to move stuff to a new menu :)). We should've thought of that way back at the beginning :), but c'est la vie.
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, we should replace the prefixes of all the strings with COMMAND or similar just to know that these are command strings.
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.
It looks like we use CMD_ as the prefix for the Command Name strings. Would it be good to use that prefix on the command constants as well?
For example:
CommandManager.register(Strings.CMD_FIND, Commands.CMD_FIND, _launchFind);
Has a nice symmetry to it, 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.
The grabber keeps failing to unzip edge-inspect-extension and that causes the tool to fail. I am only able to get about 50 extensions before the failure. I can try to fix the error.
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.
Yeah, that's the kind of thing I was running into. I tried debugging it for awhile and wasn't able to find the cause of the problem. If you can figure it out that would be great, but I wouldn't rathole on it.
I just did a grep on the set of extensions I'd downloaded as of a few weeks ago, and I did find a couple that were referring to the
EDIT_REPLACE_COMMANDS
menu group in order to add their menu commands after it. So the issue is renaming that would throw an exception, but even if we kept the old const name around as well, it still would get added at the end of the menu anyway. That might be better behavior than just breaking, though.I think we probably only need to worry about doing it for the menu groups, since those are probably the only cases where someone is referencing the existing IDs. It doesn't look like anyone is calling the commands themselves directly. We should add this to the release notes though.
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.
@njx, it's okay, I just hacked around the few that failed and grabbed them manually. I will compare my grep check to yours and supply the deprecation code in my next 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.
@njx, I found the same two you found plus an additional one that uses
Commands.EDIT_FIND
. Overall, not too bad. I will create some deprecation code, load up the extensions to make sure it works, and post issues for the extension authors.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.
Since we are changing some of the Commands constant, we should just go and change all of them. Then we can use the same deprecation code for all.