Bug 501168 - Simplify overriding of contributed logical structure definitions
Summary: Simplify overriding of contributed logical structure definitions
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.6   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-09 14:24 EDT by Carsten Reckord CLA
Modified: 2017-05-17 10:19 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carsten Reckord CLA 2016-09-09 14:24:07 EDT
It is no longer possible to override contributed logical structure definitions with custom ones.

I used to have custom logical structure definitions, e.g. for java.util.Map with separate child variables for keySet(), entrySet() and values(). This is no longer possible. The logical structure definition for java.util.Map contributed by jdt.debug can neither be edited nor removed. A new definition for the same type is disregarded in favor of the contributed definition.

I'm not sure in which JDT version this broke. I had to redo my workspace setup a while ago and never got around to configuring my custom definitions. Now I took the opportunity after updating to Neon, and realized that this was broken.
Comment 1 Markus Keller CLA 2017-03-23 07:10:32 EDT
I'm not sure if there was any change here. In I20170321-2000, I can still define a new structure on the Logical Structures page.

To activate your new structure in the Variables view, you have to open the context menu on an instance of the specified type and then choose
"Show Structure As > Name-of-new-structure"

I agree it's inconvenient that
- I can't copy a contributed structure as a template, and
- the "Edit Logical Structure..." context menu item doesn't appear on a type for which there is a pre-defined structure (would probably have to be called "Add Logical Structure..." in this case)
Comment 2 Carsten Reckord CLA 2017-03-23 12:14:30 EDT
(In reply to Markus Keller from comment #1)
> To activate your new structure in the Variables view, you have to open the
> context menu on an instance of the specified type and then choose
> "Show Structure As > Name-of-new-structure"

Ah, I didn't know that you could have different structures for the same class. That's good enough for me ;)

> I'm not sure if there was any change here. In I20170321-2000, I can still
> define a new structure on the Logical Structures page.

Not sure when this changed, but in past Eclipses, I could just change the contributed structure instead of creating a new one.

I'm fine with closing this as WONTFIX.
Comment 3 Markus Keller CLA 2017-03-30 09:27:05 EDT
Let's keep this bug as an enhancement request to streamline the process of adding alternative logical structure definitions.
Comment 4 Markus Keller CLA 2017-04-06 10:48:38 EDT
Concrete enhancement request:

- Add menu item "Edit Logical Structure..." as the last submenu item of the "Show Structure As" context menu item.
  - Insert a separator before.
  - The action should open the preference page and select the currently selected logical structure (or if all are unchecked, select the first one who's type matches the selected object).

- I sometimes see an "Edit Logical Structure..." action at the top level of the context menu, but it's always disabled, and it's at an odd place. Remove that action.

- In the Logical Structures preference page, add a button "Clone..." that is enabled on any single-selection. This opens a dialog similar to the "Add..." button, but which is pre-filled with a copy of the selected structure (this should work for pre-defined and for user-defined structures).
Comment 5 Markus Keller CLA 2017-05-17 10:19:31 EDT
(In reply to Markus Keller from comment #4)
The issues with "Edit Logical Structure..." have been resolved as part of bug 409065.

Open issue:

> - In the Logical Structures preference page, add a button "Clone..." that is
> enabled on any single-selection. This opens a dialog similar to the "Add..."
> button, but which is pre-filled with a copy of the selected structure (this
> should work for pre-defined and for user-defined structures).


And this one would also be nice:

(In reply to Markus Keller from comment #1)
> - the "Edit Logical Structure..." context menu item doesn't appear on a type
> for which there is a pre-defined structure (would probably have to be called
> "Add Logical Structure..." in this case)

Now that the top-level menu item is called "Show Logical Structure", we could just enable this for all single selections. In case there is no logical structure for the selected type yet, then we could add a single submenu item "Add Logical Structure..." that would:
- open the Logical Structures preference page
- click Add...
- enter the qualified type name for the selection
  - if case an anonymous type is selected, use the supertype or superinterface