Skip to content

Honor expression context when creating Watches#2311

Open
SougandhS wants to merge 1 commit intoeclipse-platform:masterfrom
SougandhS:ImproveWatchExp
Open

Honor expression context when creating Watches#2311
SougandhS wants to merge 1 commit intoeclipse-platform:masterfrom
SougandhS:ImproveWatchExp

Conversation

@SougandhS
Copy link
Contributor

@SougandhS SougandhS commented Dec 12, 2025

When selecting a field under an object, both the Watch command and Drag & Drop previously created a non-contextual expression using only the field name, which causes evaluation failures. This fix ensures that both Watch and Drag & Drop now generate proper context-aware expressions such as myobj.myfield instead of just the field name.

Fixes : https://bugs.eclipse.org/bugs/show_bug.cgi?id=321289

Before [Watch by context and by drag-drop] :

Before.mp4

After [Watch by context and by drag-drop] :

After.mp4

@github-actions
Copy link
Contributor

github-actions bot commented Dec 12, 2025

Test Results

    54 files  ±0      54 suites  ±0   36m 53s ⏱️ - 1m 18s
 4 546 tests ±0   4 523 ✅ ±0   23 💤 ±0  0 ❌ ±0 
12 234 runs  ±0  12 075 ✅ ±0  159 💤 ±0  0 ❌ ±0 

Results for commit 19310a5. ± Comparison against base commit 8a99f8c.

♻️ This comment has been updated with latest results.

@SougandhS SougandhS force-pushed the ImproveWatchExp branch 2 times, most recently from 9f1d82f to 94c201a Compare December 12, 2025 04:01
@SougandhS SougandhS force-pushed the ImproveWatchExp branch 3 times, most recently from 691bfc1 to ed20f18 Compare January 8, 2026 13:00
@SougandhS
Copy link
Contributor Author

Hi @merks, could you please check this change when you get a moment ?

@SougandhS
Copy link
Contributor Author

Hi @iloveeclipse, could you please trigger a co-pilot review for this PR ?

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates watch-expression creation to preserve expression context (e.g., creating myobj.myfield instead of just myfield) when creating Watches via both the Watch command and drag & drop into the Expressions view, addressing evaluation failures (Bug 321289).

Changes:

  • Build context-aware expressions for nested selections using TreeSelection/TreePath in the Watch handler.
  • Build context-aware expressions for nested selections using TreeSelection/TreePath in the Expressions view drop adapter.
  • Minor refactor in WatchHandler to split out watch-expression creation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionDropAdapter.java Updates drag & drop watch-expression generation to use selection paths for contextual expressions.
debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchHandler.java Updates the Watch command to generate contextual expressions from selection paths and refactors watch creation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@SougandhS SougandhS force-pushed the ImproveWatchExp branch 2 times, most recently from 98ab017 to 1417891 Compare March 13, 2026 12:43
When selecting a field under an object, both the Watch command and Drag
& Drop previously created a non-contextual expression using only the
field name, which caused evaluation failures. This fix ensures that both
Watch and Drag & Drop now generate proper context-aware expressions such
as myobj.myfield instead of just the field name.

Fixes : https://bugs.eclipse.org/bugs/show_bug.cgi?id=321289
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