Community
Participate
Working Groups
Build id: I20111207-2118 The Quick Assist menu supports refactorings such as Extract Local Variable, Inline Local Variable, and Extract Constant but not Inline Constant. One of the results of the CodingSpectator <http://codingspectator.cs.illinois.edu/> study was that Quick Assist is a preferred method of invoking refactorings. I think that adding Inline Constant to Quick Assist would be a natural extension of Quick Assist. However, I didn't find any bug reports on this issue. So, I decided to open one. Steps to Reproduce: 1. Add a class called "C" with the following contents to a Java project: --- // C.java public class C { private static final int CONSTANT = 1; void m() { System.out.println(CONSTANT); } } --- 2. Select "CONSTANT" either in the declaration or use of the constant and press "CTRL+1". The Quick Assist menu will open but won't propose the Inline Constant refactoring. This feature request is similar to Bug 367671.
Makes sense. We already have a 'Inline local variable' quick assist, and I do not see any reason to not add a 'Inline constant' quick assist. Fix would be similar to QuickAssistProcessor.getInlineLocalProposal(...)
Quick Assist/Fix actions are intended to be quick local actions that only change a single file. We won't add refactorings as quick assists if they touch more than one file. We could do something like bug 354147, but just adding all commands one by one as quick assist is not a good strategy.