| Summary: | [quick assist] "Assign statement to local variable" should insert cast if type changed | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Lars Vogel <Lars.Vogel> | ||||
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> | ||||
| Status: | RESOLVED WONTFIX | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | deepakazad, kazm, Lars.Vogel, marcel.bruch, markus.kell.r | ||||
| Version: | 3.8 | Keywords: | helpwanted | ||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| See Also: | https://bugs.eclipse.org/bugs/show_bug.cgi?id=511175 | ||||||
| Whiteboard: | stalebug | ||||||
| Attachments: |
|
||||||
|
Description
Lars Vogel
Created attachment 206768 [details]
Example
Markus, is it possible to set up linked mode in such a way that a cast is added when the user changes the type on LHS?
void bar() {
Object foo = foo(); // change type in LHS while still in linked mode
}
Object foo(){
return null;
}
> Markus, is it possible to set up linked mode in such a way that a cast is added
> when the user changes the type on LHS?
No, AFAIK, this is not supported at the moment. The "linking" of the linked mode is implemented in LinkedPositionGroup#handleEvent(DocumentEvent), and that is currently not open for arbitrary transformations supplied by specific quick fixes.
But I remember we had other situations where this would have been handy (e.g. the "for - iterate over collection" template).
See also Bug 511175 for a quickfix in a similar area. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |