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) {
|
override fun editorActivated(vFile: VirtualFile, updater: ScriptConfigurationUpdater) {
|
||||||
|
if (!isInAffectedGradleProjectFiles(project, vFile.path)) return
|
||||||
|
|
||||||
if (useScriptConfigurationFromImportOnly()) {
|
if (useScriptConfigurationFromImportOnly()) {
|
||||||
// do nothing
|
// do nothing
|
||||||
} else {
|
} else {
|
||||||
@@ -27,6 +29,8 @@ open class GradleScriptListener(project: Project) : ScriptChangeListener(project
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun documentChanged(vFile: VirtualFile, updater: ScriptConfigurationUpdater) {
|
override fun documentChanged(vFile: VirtualFile, updater: ScriptConfigurationUpdater) {
|
||||||
|
if (!isInAffectedGradleProjectFiles(project, vFile.path)) return
|
||||||
|
|
||||||
val file = getAnalyzableKtFileForScript(vFile)
|
val file = getAnalyzableKtFileForScript(vFile)
|
||||||
if (file != null) {
|
if (file != null) {
|
||||||
// *.gradle.kts file was changed
|
// *.gradle.kts file was changed
|
||||||
@@ -35,8 +39,6 @@ open class GradleScriptListener(project: Project) : ScriptChangeListener(project
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun isApplicable(vFile: VirtualFile): Boolean {
|
override fun isApplicable(vFile: VirtualFile): Boolean {
|
||||||
if (!isGradleKotlinScript(vFile)) return false
|
return isGradleKotlinScript(vFile)
|
||||||
|
|
||||||
return isInAffectedGradleProjectFiles(project, vFile.path)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user