-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Find and Replace Functionality #1537
Find and Replace Functionality #1537
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
Signed-off-by: Tom Ludwig <[email protected]>
Signed-off-by: Tom Ludwig <[email protected]>
Signed-off-by: Tom Ludwig <[email protected]>
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 |
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). |
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.
Looks great, and thanks for writing tests! ✅
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