Skip to content

Add auto-incrementing counter placeholder to Find/Replace #3842#3843

Open
shardt68 wants to merge 4 commits intoeclipse-platform:masterfrom
shardt68:feature/find-replace-counter
Open

Add auto-incrementing counter placeholder to Find/Replace #3842#3843
shardt68 wants to merge 4 commits intoeclipse-platform:masterfrom
shardt68:feature/find-replace-counter

Conversation

@shardt68
Copy link
Copy Markdown

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

@eclipse-eca-validation
Copy link
Copy Markdown

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:

  • Committing user must have an Eclipse Account
  • Author must have an Eclipse Account

To resolve this, please:

  1. Sign in or create an Eclipse Foundation account: https://accounts.eclipse.org/user/eca
  2. Ensure your GitHub username is linked to your Eclipse account
  3. Complete and submit the ECA form

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
@shardt68 shardt68 force-pushed the feature/find-replace-counter branch from b0fa8a0 to 40f7493 Compare March 31, 2026 18:50
@eclipse-platform-bot
Copy link
Copy Markdown
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

tests/org.eclipse.ui.workbench.texteditor.tests/META-INF/MANIFEST.MF

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 patch
From f7044759e921ed582339bffad50be8b1a94aa683 Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <platform-bot@eclipse.org>
Date: Wed, 1 Apr 2026 10:34:05 +0000
Subject: [PATCH] Version bump(s) for 4.40 stream


diff --git a/tests/org.eclipse.ui.workbench.texteditor.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.ui.workbench.texteditor.tests/META-INF/MANIFEST.MF
index c39e7b8fbd..8875927c62 100644
--- a/tests/org.eclipse.ui.workbench.texteditor.tests/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.ui.workbench.texteditor.tests/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Plugin.name
 Bundle-SymbolicName: org.eclipse.ui.workbench.texteditor.tests
-Bundle-Version: 3.15.0.qualifier
+Bundle-Version: 3.15.100.qualifier
 Bundle-Vendor: %Plugin.providerName
 Bundle-Localization: plugin
 Export-Package: 
-- 
2.53.0

Further information are available in Common Build Issues - Missing version increments.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Test Results

   852 files  ± 0     852 suites  ±0   55m 51s ⏱️ + 5m 58s
 7 899 tests + 9   7 655 ✅ + 8  243 💤 ±0  1 ❌ +1 
20 199 runs  +27  19 542 ✅ +26  656 💤 ±0  1 ❌ +1 

For more details on these failures, see this check.

Results for commit c8970bd. ± Comparison against base commit 0b9521c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add auto-incrementing counter placeholder to Find/Replace

2 participants