Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Add Replace in... to context menus #8029

Merged
merged 4 commits into from
Jun 13, 2014
Merged

Add Replace in... to context menus #8029

merged 4 commits into from
Jun 13, 2014

Conversation

redmunds
Copy link
Contributor

@redmunds redmunds commented Jun 3, 2014

Add "Replace in..." to project tree and working set context menus.

https://trello.com/c/3cKG28Fn/1309-replace-in-from-file-tree

cc @njx

@njx
Copy link
Contributor

njx commented Jun 3, 2014

Wow, that was easy :) I guess it was a good refactoring.

It looks good to me at a glance. @peterflynn should probably do a final review of this along with all the other stuff.

@TomMalbran
Copy link
Contributor

Since we have an entry in the find menu for Find in Selected File/Folder, we should add one for Replace in Selected File/Folder.

@redmunds
Copy link
Contributor Author

redmunds commented Jun 4, 2014

@TomMalbran Good catch! Added.

@@ -1392,6 +1392,54 @@ define(function (require, exports, module) {
});
});

it("should do a search in folder, replace all from find bar", function () {
openTestProjectCopy(defaultSourcePath);
var dirEntry = FileSystem.getDirectoryForPath(defaultSourcePath + "/css/");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like this is actually being used, so I don't think this test is actually testing the functionality. I think you need to pass it into the call to openSearchBar() below.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, I think the reason it passes is that expectInMemoryFiles() will check that the given file is open and has the right content, but it won't check that no other files got opened from the search. You'd need to check that explicitly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@njx Would it be an issue to change expectInMemoryFiles() to not expect any other files to be open in the working set? Might as well give all tests the benefit of that extra check while we're at it...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Submitted #8117 .

I think expectInMemory() just needs to verify that working set size is same as file array size.

@peterflynn
Copy link
Member

@redmunds Done reviewing -- just that one nit plus the unit test issues NJ pointed out. Awesome that adding this was so clean & simple!

@njx
Copy link
Contributor

njx commented Jun 13, 2014

I'm going to go ahead and merge all these PRs into replace-across-files, and address the review comments in a new PR into that branch, so all the new code changes are in one place. @redmunds I'll probably just go ahead and just fix the items noted here as part of that.

njx added a commit that referenced this pull request Jun 13, 2014
Add Replace in... to context menus
@njx njx merged commit f6d3efc into nj/replace-on-disk Jun 13, 2014
@njx njx deleted the randy/replace-in branch June 18, 2014 20:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants