Skip to content

Commit

Permalink
Merge pull request #21 from Berkeley-CS61B/deprecate-fix
Browse files Browse the repository at this point in the history
Deprecate fix
  • Loading branch information
davidmyang authored Aug 29, 2024
2 parents 9c2c2c2 + e802f4d commit e100be4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@

### Changed


- Fall 2024 style checker
34 changes: 21 additions & 13 deletions src/main/java/edu/berkeley/cs61b/plugin/CheckStyleAction.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
package edu.berkeley.cs61b.plugin;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

import org.jetbrains.annotations.NotNull;
import org.xml.sax.InputSource;

import com.intellij.execution.filters.OpenFileHyperlinkInfo;
import com.intellij.execution.ui.ConsoleView;
import com.intellij.execution.ui.ConsoleViewContentType;
import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
Expand All @@ -20,19 +36,6 @@
import com.puppycrawl.tools.checkstyle.api.AuditEvent;
import com.puppycrawl.tools.checkstyle.api.AuditListener;
import com.puppycrawl.tools.checkstyle.api.Configuration;
import org.xml.sax.InputSource;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

public class CheckStyleAction extends AnAction {
private static final String CONFIG_ROOT = "style_config/";
Expand Down Expand Up @@ -84,6 +87,11 @@ public void actionPerformed(AnActionEvent event) {
}
}

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

private void collectFiles(VirtualFile[] parent, List<File> list) {
LinkedList<VirtualFile> sources = new LinkedList<>();
Collections.addAll(sources, parent);
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/edu/berkeley/cs61b/plugin/SettingsAction.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package edu.berkeley.cs61b.plugin;

import org.jetbrains.annotations.NotNull;

import com.intellij.ide.util.PropertiesComponent;
import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.ui.DialogWrapper;
import org.jetbrains.annotations.NotNull;

public class SettingsAction extends AnAction {
@Override
Expand All @@ -19,4 +21,9 @@ public void actionPerformed(@NotNull AnActionEvent e) {
props.setValue(PluginUtils.KEY_SEMESTER, form.getSemesterField().getText());
}
}

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

0 comments on commit e100be4

Please sign in to comment.