Minor: reformat and rearrange code
This commit is contained in:
@@ -43,8 +43,12 @@ interface ScriptDefinitionProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun findScriptDefinition(file: VirtualFile, project: Project): KotlinScriptDefinition? {
|
fun findScriptDefinition(file: VirtualFile, project: Project): KotlinScriptDefinition? {
|
||||||
if (file.isDirectory) return null
|
if (file.isDirectory ||
|
||||||
if (file.extension == KotlinFileType.EXTENSION || file.extension == JavaClassFileType.INSTANCE.defaultExtension) return null
|
file.extension == KotlinFileType.EXTENSION ||
|
||||||
|
file.extension == JavaClassFileType.INSTANCE.defaultExtension
|
||||||
|
) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
val psiFile = PsiManager.getInstance(project).findFile(file)
|
val psiFile = PsiManager.getInstance(project).findFile(file)
|
||||||
if (psiFile != null) {
|
if (psiFile != null) {
|
||||||
@@ -85,7 +89,7 @@ abstract class LazyScriptDefinitionProvider : ScriptDefinitionProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected open fun nonScriptFileName(fileName: String) = nonScriptFilenameSuffixes.any {
|
protected open fun nonScriptFileName(fileName: String) = nonScriptFilenameSuffixes.any {
|
||||||
fileName.endsWith( it, ignoreCase = true)
|
fileName.endsWith(it, ignoreCase = true)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun findScriptDefinition(fileName: String): KotlinScriptDefinition? =
|
override fun findScriptDefinition(fileName: String): KotlinScriptDefinition? =
|
||||||
|
|||||||
Reference in New Issue
Block a user