IJ file type optimizations based on extension
#KTIJ-21668 Merge-request: KT-MR-6288 Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com>
This commit is contained in:
committed by
Space
parent
4a6466e290
commit
efd5beb49b
@@ -314,7 +314,7 @@ class KotlinCoreEnvironment private constructor(
|
||||
private val VirtualFile.javaFiles: List<VirtualFile>
|
||||
get() = mutableListOf<VirtualFile>().apply {
|
||||
VfsUtilCore.processFilesRecursively(this@javaFiles) { file ->
|
||||
if (file.fileType == JavaFileType.INSTANCE) {
|
||||
if (file.extension == JavaFileType.DEFAULT_EXTENSION || file.fileType == JavaFileType.INSTANCE) {
|
||||
add(file)
|
||||
}
|
||||
true
|
||||
|
||||
+1
-1
@@ -310,7 +310,7 @@ object TopDownAnalyzerFacadeForJVM {
|
||||
// 'isDirectory' check is needed because otherwise directories such as 'frontend.java' would be recognized
|
||||
// as Java source files, which makes no sense
|
||||
override fun contains(file: VirtualFile) =
|
||||
file.fileType === JavaFileType.INSTANCE && !file.isDirectory
|
||||
(file.extension == JavaFileType.DEFAULT_EXTENSION || file.fileType === JavaFileType.INSTANCE) && !file.isDirectory
|
||||
|
||||
override fun toString() = "All Java sources in the project"
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ inline fun List<KotlinSourceRoot>.forAllFiles(
|
||||
continue
|
||||
}
|
||||
|
||||
if (!vFile.isDirectory && vFile.fileType != KotlinFileType.INSTANCE) {
|
||||
if (!vFile.isDirectory && vFile.extension != KotlinFileType.EXTENSION && vFile.fileType != KotlinFileType.INSTANCE) {
|
||||
configuration.report(CompilerMessageSeverity.ERROR, "Source entry is not a Kotlin file: $sourceRootPath", reportLocation)
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user