Move refactoring on kts fixes

Set file target filenames to kts if moved declarations are from kts
Fixed exceptions throwing on script declaration move that could lead to not valid file state (Fixed #KT-36129)
This commit is contained in:
Igor Yakovlev
2020-01-29 14:20:43 +03:00
parent e05df9d838
commit ff831aded4
2 changed files with 4 additions and 2 deletions
@@ -29,6 +29,7 @@ abstract class ScriptChangeListener(protected val project: Project) {
protected fun getAnalyzableKtFileForScript(vFile: VirtualFile): KtFile? {
if (project.isDisposed) return null
if (!vFile.isValid) return null
return runReadAction {
(PsiManager.getInstance(project).findFile(vFile) as? KtFile)?.takeIf {