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

feat: refresh file system #36

Merged
merged 2 commits into from
Apr 25, 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 @@ -19,10 +19,7 @@ import com.intellij.openapi.vfs.VfsUtil
import com.intellij.psi.PsiDirectory
import com.intellij.psi.PsiFileFactory
import com.intellij.psi.PsiManager
import com.vaadin.plugin.copilot.handler.RedoHandler
import com.vaadin.plugin.copilot.handler.ShowInIdeHandler
import com.vaadin.plugin.copilot.handler.UndoHandler
import com.vaadin.plugin.copilot.handler.WriteFileHandler
import com.vaadin.plugin.copilot.handler.*
import com.vaadin.plugin.copilot.service.CopilotServerService
import java.io.BufferedWriter
import java.io.File
Expand Down Expand Up @@ -54,6 +51,7 @@ class CopilotPluginUtil {
WRITE("write"),
UNDO("undo"),
REDO("redo"),
REFRESH("refresh"),
SHOW_IN_IDE("showInIde")
}

Expand Down Expand Up @@ -145,6 +143,7 @@ class CopilotPluginUtil {
HANDLERS.UNDO.command -> return UndoHandler(project, data)
HANDLERS.REDO.command -> return RedoHandler(project, data)
HANDLERS.SHOW_IN_IDE.command -> return ShowInIdeHandler(project, data)
HANDLERS.REFRESH.command -> return RefreshHandler(project)
else -> {
LOG.warn("Command $command not supported by plugin")
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.vaadin.plugin.copilot.handler

import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFileManager

class RefreshHandler(project: Project) : AbstractHandler(project) {

override fun run() {
VirtualFileManager.getInstance().asyncRefresh { }
}

}