Find and Replace Functionality#1537
Merged
FastestMolasses merged 20 commits intoCodeEditApp:mainfrom Jan 30, 2024
Merged
Conversation
This commit includes 3 versions of a search and replace function; Also removes an unnecessary map;
Reason: Match Whole Word is already included in the search menu picker
When using options like: "Starting with" or "Ending With" the search results were not correct.
…ound during replace operation
CodeEdit/Features/Documents/WorkspaceDocument+FindAndReplace.swift
Outdated
Show resolved
Hide resolved
Collaborator
Signed-off-by: Tom Ludwig <tommludwig@icloud.com>
Signed-off-by: Tom Ludwig <tommludwig@icloud.com>
Signed-off-by: Tom Ludwig <tommludwig@icloud.com>
Member
Author
|
I've changed the symbol and added a For folks who missed the meetup: I wanted to highlight the difference between an unsuccessful search and a unsuccessful find-and-replace. Untitled.mov |
Member
Author
|
For reviewers: The existing search and Find And Replace algorithm lacks real-time progress visibility for users, meaning it doesn't promptly display the found files or terms that have been replaced. I already have plans for an upcoming pull request where the results will be delivered incrementally (the result will be returned in chunks). |
austincondiff
approved these changes
Jan 28, 2024
Collaborator
austincondiff
left a comment
There was a problem hiding this comment.
Looks great, and thanks for writing tests! ✅
0xWDG
approved these changes
Jan 28, 2024
FastestMolasses
approved these changes
Jan 30, 2024
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

This PR adds simple search and replace functions.
The first one,
searchAndReplace, can replace all occurrences of a search term across the workspace. The second,replaceRange, lets you replace text in a specific range within a file. Depending on the range, it's useful for replacing a single term in a file or even within a function.Additional Improvements
Related Issues
Checklist
- [ ] testSearchWithOptionRegularExpression()- [ ] testFindAndReplaceWithOptionRegularExpression()Screenshots