GradleScriptListener should be applicable for all gradle scripts
Not only for those that are in project Otherwise changes in those unrelated to gradle project script will affect up to date of other scripts
This commit is contained in:
+5
-3
@@ -18,6 +18,8 @@ open class GradleScriptListener(project: Project) : ScriptChangeListener(project
|
||||
}
|
||||
|
||||
override fun editorActivated(vFile: VirtualFile, updater: ScriptConfigurationUpdater) {
|
||||
if (!isInAffectedGradleProjectFiles(project, vFile.path)) return
|
||||
|
||||
if (useScriptConfigurationFromImportOnly()) {
|
||||
// do nothing
|
||||
} else {
|
||||
@@ -27,6 +29,8 @@ open class GradleScriptListener(project: Project) : ScriptChangeListener(project
|
||||
}
|
||||
|
||||
override fun documentChanged(vFile: VirtualFile, updater: ScriptConfigurationUpdater) {
|
||||
if (!isInAffectedGradleProjectFiles(project, vFile.path)) return
|
||||
|
||||
val file = getAnalyzableKtFileForScript(vFile)
|
||||
if (file != null) {
|
||||
// *.gradle.kts file was changed
|
||||
@@ -35,8 +39,6 @@ open class GradleScriptListener(project: Project) : ScriptChangeListener(project
|
||||
}
|
||||
|
||||
override fun isApplicable(vFile: VirtualFile): Boolean {
|
||||
if (!isGradleKotlinScript(vFile)) return false
|
||||
|
||||
return isInAffectedGradleProjectFiles(project, vFile.path)
|
||||
return isGradleKotlinScript(vFile)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user