Skip to content

Add Java content assist in Expressions view - #1030

Open
SougandhS wants to merge 2 commits into
eclipse-jdt:masterfrom
SougandhS:ExpressionAutoCom2
Open

SougandhS wants to merge 2 commits into
eclipse-jdt:masterfrom
SougandhS:ExpressionAutoCom2

Conversation

@SougandhS

Copy link
Copy Markdown
Member

Implement IWatchExpressionCellEditorFactory for jdt so that the Expressions view inline editor and the Add/Edit Watch Expression dialog both offer Java-aware content assist when a Java stack frame is the active debug context.

exp

What it does

How to test

Author checklist

Implement IWatchExpressionCellEditorFactory for jdt so that the
Expressions view inline editor and the Add/Edit Watch Expression
dialog both offer Java-aware content assist when a Java stack frame is
the active debug context.
@SougandhS

Copy link
Copy Markdown
Member Author

This PR requires : eclipse-platform/eclipse.platform#2989

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Completion-popup keyboard and focus interactions require interactive SWT validation before approval.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
What changed in this PR

Adds Java-aware content assist to watch-expression editing when a Java stack frame is active.

Changes:

  • Adds a Java source-viewer-based inline cell editor.
  • Configures Java completion and document partitioning for watch-expression dialogs.
  • Exposes the editor factory through Java stack-frame adaptation.
File Description
org.eclipse.jdt.debug.ui/​ui/​org/​eclipse/​jdt/​internal/​debug/​ui/​variables/​JDISourceViewerCellEditor.java Implements inline Java expression editing.
org.eclipse.jdt.debug.ui/​ui/​org/​eclipse/​jdt/​internal/​debug/​ui/​variables/​JavaWatchExpressionCellEditorFactory.java Creates inline editors and configures dialog viewers.
org.eclipse.jdt.debug.ui/​ui/​org/​eclipse/​jdt/​internal/​debug/​ui/​variables/​ColumnPresentationAdapterFactory.java Provides the watch-expression editor adapter.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +97 to +99
if (e.keyCode == ' ' && (e.stateMask & SWT.CTRL) != 0) {
fViewer.doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS);
e.doit = false;
Comment on lines +94 to +112
fViewer.getTextWidget().addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
if (e.keyCode == ' ' && (e.stateMask & SWT.CTRL) != 0) {
fViewer.doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS);
e.doit = false;
} else if (e.keyCode == SWT.CR && (e.stateMask & SWT.SHIFT) == 0) {
if (fProposalPopupOpen) {
return;
}
fireApplyEditorValue();
deactivate();
e.doit = false;
} else if (e.keyCode == SWT.ESC) {
fireCancelEditor();
e.doit = false;
}
}
});
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.

2 participants