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

Fixing preview component #121

Merged
merged 3 commits into from
Aug 9, 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
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import java.time.format.DateTimeFormatter


plugins {
id "org.jetbrains.intellij" version "1.17.2"
id "org.jetbrains.intellij" version "1.17.4"
}

allprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.intellij.notification.Notification;
import com.intellij.notification.NotificationType;
import com.intellij.notification.Notifications;
import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.Project;
Expand All @@ -11,6 +12,11 @@

public class RestartALSServerAction extends AnAction {

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

@Override
public void update(@NotNull AnActionEvent e) {
e.getPresentation().setEnabled(e.getProject() != null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


import com.intellij.icons.AllIcons;
import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.Project;
Expand Down Expand Up @@ -29,6 +30,11 @@ public RefreshASTAction() {
super("Ast Graph", "Show ast graph from current file", AllIcons.Actions.Refresh);
}

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

@Override
public void actionPerformed(AnActionEvent e) {
PsiFile currentFile = getCurrentFile();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


import com.intellij.icons.AllIcons;
import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.Project;
Expand All @@ -28,6 +29,11 @@ public RefreshASTAction() {
super("Dependency Graph", "Show dependencies from the modules.", AllIcons.Actions.Refresh);
}

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

@Override
public void actionPerformed(AnActionEvent e) {
final String text = WeaveToolingService.getInstance(project).dependencyGraph();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


import com.intellij.icons.AllIcons;
import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.Project;
Expand Down Expand Up @@ -29,6 +30,11 @@ public RefreshASTAction() {
super("Type Graph", "Show type graph from current file", AllIcons.Actions.Refresh);
}

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

@Override
public void actionPerformed(AnActionEvent e) {
PsiFile currentFile = getCurrentFile();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


import com.intellij.icons.AllIcons;
import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.Project;
Expand Down Expand Up @@ -29,6 +30,11 @@ public RefreshASTAction() {
super("Variable Graph", "Show Variable Graph from current file", AllIcons.Actions.Refresh);
}

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

@Override
public void actionPerformed(AnActionEvent e) {
PsiFile currentFile = getCurrentFile();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@ public static JavaParameters createJavaParameters(Project project, String mainCl
javaParams.setJdk(manager.getProjectSdk());
// All modules to use the same things
final Module[] modules = ModuleManager.getInstance(project).getModules();
if (modules.length > 0) {
for (Module module : modules) {
ApplicationManager.getApplication().runReadAction(() -> {
try {
javaParams.configureByModule(module, JavaParameters.JDK_AND_CLASSES_AND_TESTS);
} catch (CantRunException ignored) {
}
});
}
for (Module module : modules) {
ApplicationManager.getApplication().runReadAction(() -> {
try {
javaParams.configureByModule(module, JavaParameters.JDK_AND_CLASSES_AND_TESTS);
} catch (CantRunException ignored) {
}
});
}
javaParams.setMainClass(mainClass);
setupDefaultVMParams(javaParams);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
import com.intellij.diff.requests.SimpleDiffRequest;
import com.intellij.icons.AllIcons;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.DefaultActionGroup;
import com.intellij.openapi.actionSystem.ToggleAction;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
Expand Down Expand Up @@ -188,11 +185,22 @@ public void onPreviewResultFailed() {
this.content.setDisplayName("Output \u274C - At: " + getCurrentTime() + "");
}

public void close() {
this.currentFile = null;
}

private class SaveOutputAction extends AnAction {


public SaveOutputAction() {
super("Save as Expected Output", "Save as expected output", AllIcons.Actions.Menu_saveall);
}

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

@Override
public void update(@NotNull AnActionEvent e) {
super.update(e);
Expand Down Expand Up @@ -228,6 +236,12 @@ public ShowDiffAction() {
super("Show Diff with Expected", "Show diff", AllIcons.Actions.Diff);
}


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

@Override
public void update(@NotNull AnActionEvent e) {
super.update(e);
Expand Down
Loading
Loading