Skip to content

Commit

Permalink
Update status message when the current changelist is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
jshiell committed Jun 5, 2023
1 parent d12ec58 commit fc8dfb3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.vcs.changes.ChangeListManager;
import com.intellij.openapi.vfs.VirtualFile;
import org.infernus.idea.checkstyle.toolwindow.CheckStyleToolWindowPanel;
import org.jetbrains.annotations.NotNull;

import java.util.List;
Expand All @@ -25,7 +26,12 @@ public final void actionPerformed(final @NotNull AnActionEvent event) {
project(event).ifPresent(project -> {
try {
List<VirtualFile> affectedFiles = ChangeListManager.getInstance(project).getAffectedFiles();
if (!affectedFiles.isEmpty()) {
if (affectedFiles.isEmpty()) {
CheckStyleToolWindowPanel checkStyleToolWindowPanel = CheckStyleToolWindowPanel.panelFor(project);
if (checkStyleToolWindowPanel != null) {
checkStyleToolWindowPanel.displayWarningResult("plugin.status.in-progress.no-modified-files");
}
} else {
staticScanner(project).asyncScanFiles(
affectedFiles,
getSelectedOverride(toolWindow(project)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ plugin.results.unknown-source=unknown
plugin.status.in-progress.current=Scanning current file...
plugin.status.in-progress.module=Scanning current module...
plugin.status.in-progress.no-file=No file is open for editing
plugin.status.in-progress.no-modified-files=There are no modified files in the current changelist
plugin.status.in-progress.no-module=The current file being edited does not belong to a module
plugin.status.in-progress.project=Scanning current project...
plugin.status.in-progress.out-of-scope=Scan was skipped as file is out of scope
Expand Down

0 comments on commit fc8dfb3

Please sign in to comment.