Skip to content

WIP - Add opt-in block-end code mining - #4226

Draft
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:lv/block-end-codemining
Draft

WIP - Add opt-in block-end code mining#4226
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:lv/block-end-codemining

Conversation

@vogella

@vogella vogella commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Adds a language-agnostic code mining that echoes a block's opening line at its closing brace, so an isolated } tells you which block it terminates. The echoed text is prefixed with // so it reads like the closing brace comment people write by hand.

Braces are matched purely structurally over the default document partitioning, which keeps org.eclipse.ui.workbench.texteditor free of any dependency on JDT or a language model: braces inside comments and strings are skipped whenever a partitioner is installed, and otherwise the whole document is treated as code. To avoid clutter a block is only annotated when it spans at least a configurable number of lines (default 20) or contains a nested block, and the feature is off by default behind a new checkbox on the Text Editors preference page.

Still marked WIP: the rendering has not been verified in a running IDE yet, and the default threshold of 20 lines is a guess that deserves a second opinion.

Add a language-agnostic code mining that echoes a block's opening line at
its closing brace, making it easier to see which block a closing brace
belongs to. The echoed text is prefixed with "// " so it reads like the
closing brace comment people write by hand.

Braces are matched purely structurally over the default document
partitioning, so braces inside comments and strings are ignored when a
partitioner is available; otherwise the whole document is treated as
code. There is no dependency on JDT or any language model.

To avoid clutter the mining is only shown when a block spans at least a
configurable number of lines (default 20) or contains a nested block.
The feature is registered by default but disabled via preferences and
can be enabled together with the minimum block size on the Text Editors
preference page.
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Test Results

   858 files  ± 0     858 suites  ±0   45m 21s ⏱️ - 3m 41s
 8 136 tests + 7   7 893 ✅ + 7  243 💤 ±0  0 ❌ ±0 
20 310 runs  +21  19 656 ✅ +21  654 💤 ±0  0 ❌ ±0 

Results for commit f1dd834. ± Comparison against base commit 3b87cba.

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.

1 participant