diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/KtCommonFile.kt b/compiler/psi/src/org/jetbrains/kotlin/psi/KtCommonFile.kt index 0c42d1395bc4a..34271b922f994 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/psi/KtCommonFile.kt +++ b/compiler/psi/src/org/jetbrains/kotlin/psi/KtCommonFile.kt @@ -116,8 +116,9 @@ open class KtCommonFile(viewProvider: FileViewProvider, val isCompiled: Boolean) } } + @Deprecated("Use 'isScript()' instead", ReplaceWith("isScript()")) val isScriptByTree: Boolean - get() = script != null + get() = isScript() /** * @return modifier lists that do not belong to any declaration due to incomplete code or syntax errors @@ -266,7 +267,7 @@ open class KtCommonFile(viewProvider: FileViewProvider, val isCompiled: Boolean) hasImportAlias = null } - fun isScript(): Boolean = isScript ?: greenStub?.isScript() ?: isScriptByTree + fun isScript(): Boolean = isScript ?: greenStub?.isScript() ?: (script != null) fun hasTopLevelCallables(): Boolean { hasTopLevelCallables?.let { return it } diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/StubIndexService.kt b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/StubIndexService.kt index f4a7f9a685d17..edcb58eb23c90 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/StubIndexService.kt +++ b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/StubIndexService.kt @@ -43,7 +43,7 @@ open class StubIndexService protected constructor() { } open fun createFileStub(file: KtFile): KotlinFileStub { - return KotlinFileStubImpl(file, file.packageFqName.asString(), file.isScriptByTree) + return KotlinFileStubImpl(file, file.packageFqName.asString(), file.isScript()) } @Throws(IOException::class)