Skip to content

Commit

Permalink
override getActionUpdateThread
Browse files Browse the repository at this point in the history
Signed-off-by: he1pa <[email protected]>
  • Loading branch information
He1pa committed Jul 10, 2024
1 parent 893de7f commit 513505d
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pluginGroup = io.kusionstack.kcl
pluginName = intellij-kcl
pluginRepositoryUrl = https://github.com/KusionStack/intellij-kcl
# SemVer format -> https://semver.org
pluginVersion = 0.1.18
pluginVersion = 0.1.19

# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 221
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
package io.kusionstack.kcl.action;

import com.intellij.openapi.actionSystem.ActionUpdateThread;
import io.kusionstack.kcl.util.KCLBinaryUtil;
import io.kusionstack.kcl.util.KCLFmtCommand;
import com.intellij.openapi.actionSystem.AnActionEvent;
Expand Down Expand Up @@ -40,4 +41,9 @@ public void actionPerformed(@NotNull AnActionEvent e) {
KCLFmtCommand.execute(file);
VfsUtil.markDirtyAndRefresh(true, true, true, file);
}

@Override
public @NotNull ActionUpdateThread getActionUpdateThread(){
return ActionUpdateThread.BGT;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
package io.kusionstack.kcl.action;

import com.intellij.openapi.actionSystem.ActionUpdateThread;
import io.kusionstack.kcl.KCLFileType;
import io.kusionstack.kcl.util.KCLBinaryUtil;
import io.kusionstack.kcl.util.KCLFmtCommand;
Expand Down Expand Up @@ -54,4 +55,9 @@ public boolean isKCLFile(VirtualFile virtualFile) {
}
return false;
}

@Override
public @NotNull ActionUpdateThread getActionUpdateThread(){
return ActionUpdateThread.BGT;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*/
package io.kusionstack.kcl.action;

import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.DefaultActionGroup;
import org.jetbrains.annotations.NotNull;
Expand All @@ -16,4 +18,9 @@ public class KCLToolsPopUpActionGroup extends DefaultActionGroup {
public void update(@NotNull AnActionEvent e) {
// enable/disable depending on whether user is editing...
}

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.BGT;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
*/
package io.kusionstack.kcl.action;

import com.intellij.openapi.actionSystem.ActionUpdateThread;
import org.jetbrains.annotations.NotNull;

/**
* @author amyxia
* @version OpenKCLHelpAction: OpenKCLHelpAction.java, v 0.1 2020年12月03日 3:22 下午 amyxia Exp $
Expand All @@ -12,4 +15,9 @@ public class OpenKCLHelpAction extends OpenLinkAction {
public String getLink() {
return "https://kusionstack.io/docs/reference/lang/lang/tour";
}

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.BGT;
}
}
6 changes: 6 additions & 0 deletions src/main/java/io/kusionstack/kcl/action/OpenLinkAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package io.kusionstack.kcl.action;

import com.intellij.ide.BrowserUtil;
import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.DumbAwareAction;
import org.jetbrains.annotations.NotNull;
Expand All @@ -19,4 +20,9 @@ public abstract class OpenLinkAction extends DumbAwareAction {
public void actionPerformed(@NotNull AnActionEvent e) {
BrowserUtil.browse(getLink());
}

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.BGT;
}
}

0 comments on commit 513505d

Please sign in to comment.