Skip to content

Commit 6f950d4

Browse files
committed
fix #708, fix #712, close #713
1 parent 8cf7b35 commit 6f950d4

File tree

17 files changed

+264
-75
lines changed

17 files changed

+264
-75
lines changed

build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id 'java-library'
33
id 'org.jetbrains.intellij' version '1.14.2'
4+
id("org.jetbrains.kotlin.jvm") version "1.9.23"
45
id 'org.jetbrains.changelog' version "1.3.1"
56
id "de.undercouch.download" version "4.0.2"
67
}

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pluginUntilBuild =
77
pluginDescription = doc/description.html
88

99
platformType = IU
10-
platformVersion = 2022.1
10+
platformVersion = 2022.2
1111

1212
# ,-Dide.browser.jcef.log.level=verbose,-Duser.language=en-US
1313
runIdeJvmArgs = -Dfile.encoding=utf-8

src/main/java/com/shuzijun/leetcode/plugin/actions/AbstractAction.java

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.shuzijun.leetcode.plugin.actions;
22

3+
import com.intellij.openapi.actionSystem.ActionUpdateThread;
34
import com.intellij.openapi.actionSystem.AnAction;
45
import com.intellij.openapi.actionSystem.AnActionEvent;
56
import com.intellij.openapi.options.ShowSettingsUtil;
@@ -47,5 +48,10 @@ public void run(@NotNull ProgressIndicator progressIndicator) {
4748

4849
}
4950

51+
@Override
52+
public @NotNull ActionUpdateThread getActionUpdateThread() {
53+
return ActionUpdateThread.BGT;
54+
}
55+
5056
public abstract void actionPerformed(AnActionEvent anActionEvent, Config config);
5157
}

src/main/java/com/shuzijun/leetcode/plugin/actions/editor/EditorMenuActionGroup.java

+7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package com.shuzijun.leetcode.plugin.actions.editor;
22

3+
import com.intellij.openapi.actionSystem.ActionUpdateThread;
34
import com.intellij.openapi.actionSystem.AnActionEvent;
45
import com.intellij.openapi.actionSystem.DefaultActionGroup;
56
import com.intellij.openapi.actionSystem.PlatformDataKeys;
67
import com.intellij.openapi.vfs.VirtualFile;
78
import com.shuzijun.leetcode.plugin.model.LeetcodeEditor;
89
import com.shuzijun.leetcode.plugin.setting.ProjectConfig;
10+
import org.jetbrains.annotations.NotNull;
911

1012
/**
1113
* @author shuzijun
@@ -24,4 +26,9 @@ public void update(AnActionEvent e) {
2426
}
2527
e.getPresentation().setEnabledAndVisible(menuAllowed);
2628
}
29+
30+
@Override
31+
public @NotNull ActionUpdateThread getActionUpdateThread() {
32+
return ActionUpdateThread.BGT;
33+
}
2734
}

src/main/java/com/shuzijun/leetcode/plugin/actions/toolbar/FindAction.java

+6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package com.shuzijun.leetcode.plugin.actions.toolbar;
22

3+
import com.intellij.openapi.actionSystem.ActionUpdateThread;
34
import com.intellij.openapi.actionSystem.AnActionEvent;
45
import com.intellij.openapi.actionSystem.ToggleAction;
56
import com.intellij.openapi.project.DumbAware;
67
import com.shuzijun.leetcode.plugin.manager.NavigatorAction;
78
import com.shuzijun.leetcode.plugin.utils.DataKeys;
89
import com.shuzijun.leetcode.plugin.window.WindowFactory;
10+
import org.jetbrains.annotations.NotNull;
911

1012
import javax.swing.*;
1113

@@ -46,4 +48,8 @@ public void setSelected(AnActionEvent anActionEvent, boolean b) {
4648
panel.setVisible(b);
4749
}
4850

51+
@Override
52+
public @NotNull ActionUpdateThread getActionUpdateThread() {
53+
return ActionUpdateThread.BGT;
54+
}
4955
}

src/main/java/com/shuzijun/leetcode/plugin/actions/toolbar/FindActionGroup.java

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.google.common.collect.Lists;
44
import com.intellij.openapi.actionSystem.ActionGroup;
5+
import com.intellij.openapi.actionSystem.ActionUpdateThread;
56
import com.intellij.openapi.actionSystem.AnAction;
67
import com.intellij.openapi.actionSystem.AnActionEvent;
78
import com.intellij.openapi.project.DumbAware;
@@ -13,6 +14,7 @@
1314
import com.shuzijun.leetcode.plugin.utils.DataKeys;
1415
import com.shuzijun.leetcode.plugin.window.WindowFactory;
1516
import icons.LeetCodeEditorIcons;
17+
import org.jetbrains.annotations.NotNull;
1618

1719
import java.util.List;
1820

@@ -97,4 +99,9 @@ private String getFilterKey(String id) {
9799
private String getKey(String id) {
98100
return id.replace(PluginConstant.LEETCODE_FIND_PREFIX, "").replace(PluginConstant.LEETCODE_ALL_FIND_PREFIX, "").replace(PluginConstant.LEETCODE_CODETOP_FIND_PREFIX, "");
99101
}
102+
103+
@Override
104+
public @NotNull ActionUpdateThread getActionUpdateThread() {
105+
return ActionUpdateThread.BGT;
106+
}
100107
}

src/main/java/com/shuzijun/leetcode/plugin/actions/toolbar/FindTagAction.java

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.shuzijun.leetcode.plugin.actions.toolbar;
22

3+
import com.intellij.openapi.actionSystem.ActionUpdateThread;
34
import com.intellij.openapi.actionSystem.AnActionEvent;
45
import com.intellij.openapi.actionSystem.ToggleAction;
56
import com.intellij.openapi.progress.ProgressIndicator;
@@ -61,5 +62,10 @@ public void run(@NotNull ProgressIndicator progressIndicator) {
6162
});
6263
}
6364

65+
@Override
66+
public @NotNull ActionUpdateThread getActionUpdateThread() {
67+
return ActionUpdateThread.BGT;
68+
}
69+
6470

6571
}

src/main/java/com/shuzijun/leetcode/plugin/actions/tree/FavoriteAction.java

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.shuzijun.leetcode.plugin.actions.tree;
22

3+
import com.intellij.openapi.actionSystem.ActionUpdateThread;
34
import com.intellij.openapi.actionSystem.AnActionEvent;
45
import com.intellij.openapi.actionSystem.ToggleAction;
56
import com.intellij.openapi.progress.ProgressIndicator;
@@ -65,4 +66,9 @@ public void run(@NotNull ProgressIndicator progressIndicator) {
6566
});
6667

6768
}
69+
70+
@Override
71+
public @NotNull ActionUpdateThread getActionUpdateThread() {
72+
return ActionUpdateThread.BGT;
73+
}
6874
}

src/main/java/com/shuzijun/leetcode/plugin/actions/tree/FavoriteActionGroup.java

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.google.common.collect.Lists;
44
import com.intellij.openapi.actionSystem.ActionGroup;
5+
import com.intellij.openapi.actionSystem.ActionUpdateThread;
56
import com.intellij.openapi.actionSystem.AnAction;
67
import com.intellij.openapi.actionSystem.AnActionEvent;
78
import com.intellij.openapi.project.DumbAware;
@@ -10,6 +11,7 @@
1011
import com.shuzijun.leetcode.plugin.model.Tag;
1112
import com.shuzijun.leetcode.plugin.utils.DataKeys;
1213
import com.shuzijun.leetcode.plugin.window.WindowFactory;
14+
import org.jetbrains.annotations.NotNull;
1315

1416
import java.util.List;
1517

@@ -39,4 +41,9 @@ public AnAction[] getChildren(AnActionEvent anActionEvent) {
3941

4042
}
4143

44+
@Override
45+
public @NotNull ActionUpdateThread getActionUpdateThread() {
46+
return ActionUpdateThread.BGT;
47+
}
48+
4249
}

src/main/java/com/shuzijun/leetcode/plugin/listener/RegisterPluginInstallerStateListener.java

-60
This file was deleted.

src/main/java/com/shuzijun/leetcode/plugin/setting/PersistentConfig.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public void savePassword(String password, String username) {
9494
if (username == null || password == null) {
9595
return;
9696
}
97-
PasswordSafe.getInstance().set(new CredentialAttributes(PluginConstant.PLUGIN_ID, username, this.getClass()), new Credentials(username, password == null ? "" : password));
97+
PasswordSafe.getInstance().set(new CredentialAttributes(PluginConstant.PLUGIN_ID, username, this.getClass()), new Credentials(username, password));
9898
}
9999

100100
public String getPassword(String username) {

0 commit comments

Comments
 (0)