Community
Participate
Working Groups
I20060912-0800 - Set the derived flag on a compilation unit - Open the CU and select the type name - Press Ctrl+2, R => Linked mode is entered, no dialog - Type a character => Characted is inserted into document, then a 'Derived File Encountered' dialog appears. If you click 'No', you end up with a dirty editor whose status line says 'Writable' but which is not editable any more.
This is a bug of the direct quick fix. It does not do the needed checks as done when invoking Ctrl+1. Same problem in R3.2 in combination with a read-only file. I guess this affects all direct quick fixes.
This problem also affects other actions that are started from an editor, e.g. Extract Local Variable. There, we already use Checks.validateModifiesFiles(IFile[], Object), which deals with read-only files, but not with the derived bit. For consistency, we should also add a check for derived files when the refactoring is started from an editor. I guess we need to make a difference based on the declaration of the element to be refactored. When I e.g. rename a type, I should get a dialog only when the declaring type is in a derived file, but not when there's just a reference in a derived file. See also bug 147516.
Fixed in HEAD with fix for bug 147516.