Repository navigation
Conversation
f1dd834 to
8a4d2f4
Compare
8a4d2f4 to
d0316e0
Compare
d0316e0 to
0434738
Compare
b2b9730 to
096ec8a
Compare
069d8ff to
181196e
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Asynchronous completion can render off the SWT thread, and Allman-style blocks can derive labels from comments.
2 open findings
What changed in this PR
Adds opt-in, language-agnostic block-end code minings to text editors.
Changes:
- Implements asynchronous structural brace matching and refresh handling.
- Adds grouped code-mining preferences with a configurable minimum block size.
- Adds unit and UI coverage for matching, preferences, and rendering.
| File | Description |
|---|---|
WorkbenchTextEditorTestSuite.java |
Registers structural matching tests. |
BlockEndCodeMiningTest.java |
Tests block detection and partition handling. |
TextEditorDefaultsPreferencePageTest.java |
Tests preference defaults and controls. |
EditorsTestSuite.java |
Registers preference and rendering tests. |
BlockEndCodeMiningRenderingTest.java |
Tests live editor rendering and refreshes. |
BlockEndCodeMiningProvider.java |
Implements block scanning and refresh behavior. |
BlockEndCodeMining.java |
Defines the rendered line-end mining. |
BlockEndCodeMiningPreferenceConstants.java |
Defines preference keys and defaults. |
org.eclipse.ui.workbench.texteditor/plugin.xml |
Registers the provider. |
org.eclipse.ui.workbench.texteditor/plugin.properties |
Adds the provider label. |
AbstractDecoratedTextEditorPreferenceConstants.java |
Initializes preference defaults. |
TextEditorMessages.properties |
Adds preference-page messages. |
TextEditorMessages.java |
Exposes the new messages. |
TextEditorDefaultsPreferencePage.java |
Adds grouped code-mining controls. |
org.eclipse.ui.editors/plugin.xml |
Registers preference-search keywords. |
org.eclipse.ui.editors/plugin.properties |
Defines block-end search terms. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
181196e to
969cdff
Compare
f1b7117 to
397d765
Compare
397d765 to
91f8efa
Compare
91f8efa to
b638aa0
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. |
d859b5a to
271dcb5
Compare
Echo a block's opening line at its closing brace, prefixed with " // ", so an isolated } tells which block it terminates. Braces are matched structurally, skipping comments and literals where a partitioning marks code as the default content type, and the provider refreshes itself after typing pauses, scanning a document copy in the background. Off by default, enabled on the Text Editors preference page in a new "Code Minings" group. Assisted-by: multiple AI agents and layers of automated tooling 🤖
271dcb5 to
94de360
Compare









Adds a best-effort, language-independent 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, which keeps
org.eclipse.ui.workbench.texteditorfree of any dependency on JDT or a language model.Braces in comments and string literals are skipped where the document has a partitioning that marks code as the default content type, including empty boundary partitions in comment-only documents.
A partitioning that uses content types of its own, as TextMate does for every text file, cannot say where the code is and is ignored. In that fallback, braces inside comments or literals can produce incorrect matches.
A block is annotated once it spans at least a configurable number of lines, 20 by default.
Nothing in the platform recomputes minings on a document change (JDT ships its own reconciler for that), so the provider follows the document itself and refreshes shortly after typing stops, scanning a copy of the document in the background.
Edits immediately cancel the current request, including a completed scan still waiting for other providers, so obsolete snapshot positions are not published by the combined code-mining refresh.
The feature is off by default behind a new checkbox on the Text Editors preference page.
Since that page is already crowded, the new setting and the existing problem annotation code mining settings now share a "Code Minings" group instead of adding two more rows to the flat option list.