mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-03-10 08:31:29 +00:00
Misc: Permit refactorings/intentions/quick fixes inside script files
#KT-20123 Fixed
This commit is contained in:
@@ -45,7 +45,7 @@ abstract class QuickFixActionBase<out T : PsiElement>(element: T) : IntentionAct
|
||||
val element = element ?: return false
|
||||
return element.isValid &&
|
||||
!element.project.isDisposed &&
|
||||
(file.manager.isInProject(file) || file is KtCodeFragment) &&
|
||||
(file.manager.isInProject(file) || file is KtCodeFragment || (file is KtFile && file.isScript())) &&
|
||||
(file is KtFile || isCrossLanguageFix) &&
|
||||
isAvailableImpl(project, editor, file)
|
||||
}
|
||||
|
||||
@@ -456,7 +456,7 @@ fun PsiElement.canRefactor(): Boolean {
|
||||
this is KtElement ||
|
||||
this is PsiMember && language == JavaLanguage.INSTANCE ||
|
||||
this is PsiDirectory ->
|
||||
ProjectRootsUtil.isInProjectSource(this)
|
||||
ProjectRootsUtil.isInProjectSource(this) || ((containingFile as? KtFile)?.isScript() ?: false)
|
||||
else ->
|
||||
false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user