Introduce Lambda Parameter: Use IDEA-provided action

This commit is contained in:
Alexey Sedunov
2016-09-13 14:04:39 +03:00
parent f0a298e27b
commit dddb4fd792
3 changed files with 1 additions and 35 deletions

View File

@@ -116,13 +116,6 @@
<add-to-group group-id="IntroduceActionsGroup" anchor="after" relative-to-action="IntroduceField"/>
</action>
<action id="IntroduceLambdaParameter"
class="org.jetbrains.kotlin.idea.refactoring.introduce.introduceParameter.IntroduceLambdaParameterAction"
text="La_mbda Parameter...">
<keyboard-shortcut keymap="$default" first-keystroke="control shift P"/>
<add-to-group group-id="IntroduceActionsGroup" anchor="after" relative-to-action="IntroduceParameter"/>
</action>
<action id="CopyAsDiagnosticTest" class="org.jetbrains.kotlin.idea.actions.internal.CopyAsDiagnosticTestAction"
text="Copy Current File As Diagnostic Test">
<keyboard-shortcut keymap="$default" first-keystroke="control alt shift T"/>

View File

@@ -39,7 +39,7 @@ class KotlinRefactoringSupportProvider : RefactoringSupportProvider() {
override fun getIntroduceParameterHandler() = KotlinIntroduceParameterHandler()
fun getIntroduceLambdaParameterHandler(): RefactoringActionHandler = KotlinIntroduceLambdaParameterHandler()
override fun getIntroduceFunctionalParameterHandler() = KotlinIntroduceLambdaParameterHandler()
fun getIntroducePropertyHandler(): RefactoringActionHandler = KotlinIntroducePropertyHandler()

View File

@@ -1,27 +0,0 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.idea.refactoring.introduce.introduceParameter
import com.intellij.lang.refactoring.RefactoringSupportProvider
import com.intellij.refactoring.RefactoringActionHandler
import org.jetbrains.kotlin.idea.refactoring.KotlinRefactoringSupportProvider
import org.jetbrains.kotlin.idea.refactoring.introduce.AbstractIntroduceAction
class IntroduceLambdaParameterAction : AbstractIntroduceAction() {
override fun getRefactoringHandler(provider: RefactoringSupportProvider): RefactoringActionHandler? =
(provider as? KotlinRefactoringSupportProvider)?.getIntroduceLambdaParameterHandler()
}