This repository was archived by the owner on Sep 6, 2021. It is now read-only.
Repository navigation
Add "replace all" button when doing find and replace - #12988
Merged
Merged
Conversation
ficristo
suggested changes
Dec 20, 2016
ficristo
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, only some nits to fix.
| "FIND_QUERY_PLACEHOLDER" : "Find\u2026", | ||
| "REPLACE_PLACEHOLDER" : "Replace with\u2026", | ||
| "BUTTON_REPLACE_ALL" : "Batch\u2026", | ||
| "BUTTON_REPLACE_ALL" : "Replace All\u2026", |
| * @param {?string} replaceText If this is a replacement, the text to replace matches with. | ||
| * @param {?$.Promise} candidateFilesPromise If specified, a promise that should resolve with the same set of files that | ||
| * getCandidateFiles(scope) would return. | ||
| * @return {$.Promise} A promise that's resolved with the search results or rejected when the find competes. |
Collaborator
There was a problem hiding this comment.
Indent one space more the jsdocs.
| return FindInFiles.doSearchInScope(queryInfo, scope, filter, replaceText, candidateFilesPromise) | ||
| .done(function (zeroFilesToken) { | ||
| // Done searching all files: replace all | ||
| if (FindInFiles.searchModel.hasResults()) { |
Collaborator
There was a problem hiding this comment.
There is a JSLint warning here: '_finishReplaceBatch' was used before it was defined.
After the var _findBar = null; aboce, you can add a new line and add a declaration, something like:
var _findBar = null;
// Forward declaration.
var _finishReplaceBatch;| replaceText = findBar.getReplaceText(); | ||
|
|
||
| if (all) { | ||
| if(all === null){ |
Collaborator
There was a problem hiding this comment.
Add one space after the if and one before the { to fix some JSLint warnings.
ficristo
approved these changes
Dec 22, 2016
Collaborator
|
LGTM, thank you. |
Collaborator
|
Great job @amrelnaggar! |
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
For #11126.
cc: @ficristo