Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(intellij): use refresh service directly and avoid going through actionPerformed #2366

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import com.intellij.util.messages.Topic
import com.intellij.util.ui.JBUI
import dev.nx.console.nx_toolwindow.tree.NxProjectsTree
import dev.nx.console.nx_toolwindow.tree.NxTreeStructure
import dev.nx.console.nxls.NxRefreshWorkspaceAction
import dev.nx.console.nxls.NxRefreshWorkspaceService
import dev.nx.console.nxls.NxWorkspaceRefreshListener
import dev.nx.console.nxls.NxlsService
Expand Down Expand Up @@ -326,7 +325,12 @@ class NxToolWindowPanel(private val project: Project) : SimpleToolWindowPanel(tr
}

override fun actionPerformed(e: AnActionEvent) {
NxRefreshWorkspaceAction().actionPerformed(e)
TelemetryService.getInstance(project)
.featureUsed(
TelemetryEvent.MISC_REFRESH_WORKSPACE,
mapOf("source" to TelemetryEventSource.PROJECTS_VIEW),
)
NxRefreshWorkspaceService.getInstance(project).refreshWorkspace()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import com.intellij.openapi.project.DumbAware
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFile
import dev.nx.console.models.NxVersion
import dev.nx.console.nxls.NxRefreshWorkspaceAction
import dev.nx.console.nxls.NxRefreshWorkspaceService
import dev.nx.console.telemetry.TelemetryEvent
import dev.nx.console.telemetry.TelemetryEventSource
import dev.nx.console.telemetry.TelemetryService
Expand Down Expand Up @@ -59,7 +59,7 @@ class ProjectDetailsEditorWithPreview(private val project: Project, file: Virtua
TelemetryEvent.MISC_REFRESH_WORKSPACE,
mapOf("source" to TelemetryEventSource.EDITOR_TOOLBAR),
)
NxRefreshWorkspaceAction().actionPerformed(e)
NxRefreshWorkspaceService.getInstance(project).refreshWorkspace()
}
}

Expand Down
Loading