Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 30, 2025

Both MiseTaskResolver and MiseConfigFileResolver were calling MiseTomlFileVfsListener.startListening() in their init blocks, creating multiple VFS and PSI tree change listener instances per project.

Changes

  • Created MiseTomlFileListener service - Project-level service that owns VFS listener registration, ensuring single initialization
  • Refactored resolver init blocks - Both resolvers now subscribe to MISE_TOML_CHANGED topic without registering listeners
  • Moved MISE_TOML_CHANGED topic - Relocated from MiseTomlFileVfsListener to MiseTomlFileListener for clearer ownership
  • Removed dead code - Deleted unused MiseLocalIndexUpdater instantiation in startListening()

Before/After

Before:

init {
    project.messageBus.connect(this).let {
        it.subscribe(MiseTomlFileVfsListener.MISE_TOML_CHANGED) { cache.clear() }
        MiseTomlFileVfsListener.startListening(project, this, it) // Duplicate registration
    }
}

After:

init {
    project.service<MiseTomlFileListener>() // Ensure listener initialized once
    project.messageBus.connect(this).subscribe(MiseTomlFileListener.MISE_TOML_CHANGED) {
        cache.clear()
    }
}

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copy link
Contributor Author

Copilot AI commented Dec 30, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cache-redirector.jetbrains.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -XX:&#43;UseParallelGC -XX:MaxMetaspaceSize=512m -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Address feedback on replacing MiseProjectService with MiseTaskResolver Eliminate duplicate VFS listener registrations in MiseTaskResolver and MiseConfigFileResolver Dec 30, 2025
Copilot AI requested a review from 134130 December 30, 2025 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants