Skip to content

Commit

Permalink
fix(intellij): use refresh service directly and avoid going through a…
Browse files Browse the repository at this point in the history
…ctionPerformed
  • Loading branch information
MaxKless committed Dec 16, 2024
1 parent 714fb4a commit 85da573
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
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

0 comments on commit 85da573

Please sign in to comment.