Skip to content

Commit 31d21a1

Browse files
committed
Copy: Disable when selection doesn't contain Kotlin source files
#KT-18390 Fixed
1 parent 423fb9d commit 31d21a1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

idea/src/org/jetbrains/kotlin/idea/refactoring/copy/CopyKotlinDeclarationsHandler.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ class CopyKotlinDeclarationsHandler : CopyHandlerDelegateBase() {
8383

8484
private fun canCopyFiles(elements: Array<out PsiElement>, fromUpdate: Boolean): Boolean {
8585
val sourceFiles = getSourceFiles(elements) ?: return false
86+
if (!sourceFiles.any { it is KtFile }) return false
8687
return copyFilesHandler.canCopy(sourceFiles, fromUpdate)
8788
}
8889

0 commit comments

Comments
 (0)