| Summary: | [typing] Paste with imports doesn't work after using Breadcrumb | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> |
| Component: | Text | Assignee: | Dani Megert <daniel_megert> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | daniel_megert |
| Version: | 3.7 | ||
| Target Milestone: | 3.8 M6 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | fix candidate | ||
I first thought that the fix for bug 296589 would also fix this one, but it looks like a slightly different retarget problem. It's enough to switch to breadcrumb and back, to disable the action (only 'copy' is broken, 'paste' continues to be bound). Oh boy, that was a hard one. By default (lowest layer) we register TextNavigationAction(s) that call the native StyledText actions. The next layer registers its own enriched actions but with different action IDs (but same action definition IDs AKA command IDs). At this point two copy actions got registered but the last one won. At the JDT level we then replace the second one but leave the first one. This still works because the sequence is OK. When we switch to the breadcrumb and back, we unregister and then re-register all actions. Unfortunately, at this point, the one which got registered initially (TextNavigationAction) now comes last and wins. Fixed in master (text): f7e9c6e267deffe8ad723ad4b8c99d360e585a7b . Verified in I20120314-1800. |
I20110528-0800, already broken in 3.5.2 Paste with imports doesn't work after using Breadcrumb. Works again after closing/reopening editor. Steps: - paste the following into Package Explorer: ///////////////////////////////////////////// package p; public class Bar { } package p; import java.io.File; import java.io.FileInputStream; public class Foo { void foo() { File f= null; FileInputStream fis= null; } } ///////////////////////////////////////////// - in the breadcrumb, click the triangle between p and Foo, and then click Bar - go back to Foo.java - select the 4 lines that define foo() - Ctrl+C - go to Bar.java - paste into the body of Bar => imports not added Also, when you select all in Foo.java and then copy, the folded import for FileInputStream is not copied.