Create From Usage: Move classes to separate package
This commit is contained in:
@@ -18,6 +18,7 @@ package org.jetbrains.jet.plugin.quickfix;
|
|||||||
|
|
||||||
import org.jetbrains.jet.lang.psi.JetClass;
|
import org.jetbrains.jet.lang.psi.JetClass;
|
||||||
import org.jetbrains.jet.plugin.codeInsight.ImplementMethodsHandler;
|
import org.jetbrains.jet.plugin.codeInsight.ImplementMethodsHandler;
|
||||||
|
import org.jetbrains.jet.plugin.quickfix.createFromUsage.CreateFunctionFromUsageFix;
|
||||||
|
|
||||||
import static org.jetbrains.jet.lang.diagnostics.Errors.*;
|
import static org.jetbrains.jet.lang.diagnostics.Errors.*;
|
||||||
import static org.jetbrains.jet.lexer.JetTokens.*;
|
import static org.jetbrains.jet.lexer.JetTokens.*;
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import org.jetbrains.jet.lang.types.JetType;
|
|||||||
import org.jetbrains.jet.lang.types.checker.JetTypeChecker;
|
import org.jetbrains.jet.lang.types.checker.JetTypeChecker;
|
||||||
import org.jetbrains.jet.plugin.caches.resolve.ResolvePackage;
|
import org.jetbrains.jet.plugin.caches.resolve.ResolvePackage;
|
||||||
import org.jetbrains.jet.plugin.presentation.JetClassPresenter;
|
import org.jetbrains.jet.plugin.presentation.JetClassPresenter;
|
||||||
|
import org.jetbrains.jet.plugin.quickfix.createFromUsage.ClassCandidate;
|
||||||
import org.jetbrains.jet.plugin.references.BuiltInsReferenceResolver;
|
import org.jetbrains.jet.plugin.references.BuiltInsReferenceResolver;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
@@ -200,7 +201,7 @@ public class QuickFixUtil {
|
|||||||
return usedParameters;
|
return usedParameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
static class ClassCandidateListCellRenderer extends PsiElementListCellRenderer<JetClass> {
|
public static class ClassCandidateListCellRenderer extends PsiElementListCellRenderer<JetClass> {
|
||||||
private final JetClassPresenter presenter = new JetClassPresenter();
|
private final JetClassPresenter presenter = new JetClassPresenter();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+2
-1
@@ -14,10 +14,11 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.jetbrains.jet.plugin.quickfix
|
package org.jetbrains.jet.plugin.quickfix.createFromUsage
|
||||||
|
|
||||||
import com.intellij.psi.PsiElement
|
import com.intellij.psi.PsiElement
|
||||||
import org.jetbrains.jet.plugin.JetBundle
|
import org.jetbrains.jet.plugin.JetBundle
|
||||||
|
import org.jetbrains.jet.plugin.quickfix.JetIntentionAction
|
||||||
|
|
||||||
public abstract class CreateFromUsageFixBase(element: PsiElement) : JetIntentionAction<PsiElement>(element) {
|
public abstract class CreateFromUsageFixBase(element: PsiElement) : JetIntentionAction<PsiElement>(element) {
|
||||||
override fun getFamilyName(): String = JetBundle.message("create.from.usage.family")
|
override fun getFamilyName(): String = JetBundle.message("create.from.usage.family")
|
||||||
+3
-1
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.jetbrains.jet.plugin.quickfix
|
package org.jetbrains.jet.plugin.quickfix.createFromUsage
|
||||||
|
|
||||||
import com.intellij.codeInsight.intention.IntentionAction
|
import com.intellij.codeInsight.intention.IntentionAction
|
||||||
import com.intellij.codeInsight.lookup.LookupElement
|
import com.intellij.codeInsight.lookup.LookupElement
|
||||||
@@ -72,6 +72,8 @@ import org.jetbrains.jet.lang.diagnostics.DiagnosticFactory
|
|||||||
import org.jetbrains.jet.lang.resolve.DescriptorToSourceUtils
|
import org.jetbrains.jet.lang.resolve.DescriptorToSourceUtils
|
||||||
import org.jetbrains.jet.lang.resolve.dataClassUtils.isComponentLike
|
import org.jetbrains.jet.lang.resolve.dataClassUtils.isComponentLike
|
||||||
import org.jetbrains.jet.lang.resolve.dataClassUtils.getComponentIndex
|
import org.jetbrains.jet.lang.resolve.dataClassUtils.getComponentIndex
|
||||||
|
import org.jetbrains.jet.plugin.quickfix.JetSingleIntentionActionFactory
|
||||||
|
import org.jetbrains.jet.plugin.quickfix.QuickFixUtil
|
||||||
|
|
||||||
private val TYPE_PARAMETER_LIST_VARIABLE_NAME = "typeParameterList"
|
private val TYPE_PARAMETER_LIST_VARIABLE_NAME = "typeParameterList"
|
||||||
private val TEMPLATE_FROM_USAGE_FUNCTION_BODY = "New Kotlin Function Body.kt"
|
private val TEMPLATE_FROM_USAGE_FUNCTION_BODY = "New Kotlin Function Body.kt"
|
||||||
Reference in New Issue
Block a user