Add auto-incrementing counter placeholder to Find/Replace #3842#3843
Add auto-incrementing counter placeholder to Find/Replace #3842#3843shardt68 wants to merge 4 commits intoeclipse-platform:masterfrom
Conversation
|
Hi @shardt68 — thank you for your contribution! The Eclipse Contributor Agreement (ECA) check has failed for this pull request due to one of the following reasons:
To resolve this, please:
Once done, push a new commit (or rebase) to re-trigger the ECA validation. If you believe you've already completed these steps, please double-check your account settings or report an issue to Eclipse Foundation Helpdesk. Thanks again for your contribution! |
…tform#3842 Adds a #{start,step,pad} counter placeholder to Find/Replace replace strings. During Replace All or Replace/Find, the placeholder expands to an auto-incrementing number with optional zero-padding. eclipse-platform#3842
b0fa8a0 to
40f7493
Compare
|
This pull request changes some projects for the first time in this development cycle. An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch. Git patchFurther information are available in Common Build Issues - Missing version increments. |
Test Results 852 files ± 0 852 suites ±0 55m 51s ⏱️ + 5m 58s For more details on these failures, see this check. Results for commit c8970bd. ± Comparison against base commit 0b9521c. |
…rdt68/eclipse.platform.ui into feature/find-replace-counter
Summary
Adds a #{start,step,pad} counter placeholder to Find/Replace replace strings. During Replace All or Replace/Find, the placeholder expands to an auto-incrementing number with optional zero-padding.
Motivation
Users working with numbered lists, SQL inserts, configuration entries, or test data frequently need sequential numbers across replacements. This currently requires external tools. Other editors (Notepad++, VS Code, IntelliJ) offer similar functionality.
Changes
org.eclipse.jface.text
FindReplaceDocumentAdapterContentProposalProvider: Counter proposal in replace field content assist
RegExMessages.properties: Display string and documentation
org.eclipse.ui.workbench.texteditor
ReplaceCounter (new): Parses #{start,step,pad}, formats with zero-padding, supports negative start/step
FindReplaceLogic: Integrates counter — parses on setReplaceString(), expands in replaceSelection(), resets in replaceAll()
Tests
ReplaceCounterTest: 16 unit tests
FindReplaceLogicTest: 9 integration tests
Syntax
Replace string Result
#{1,1,3} 001, 002, 003, …
#{10,5,0} 10, 15, 20, …
item_#{1,1,2} item_01, item_02, …
$1_#{1,1,2} (regex) Match1_01, Match1_02, …
Fixes #3842
Adds a #{start,step,pad} counter placeholder to Find/Replace replace strings. During Replace All or Replace/Find, the placeholder expands to an auto-incrementing number with optional zero-padding. #3842