Skip to content

Commit

Permalink
Resolve a TODO in NativeEditorNotificationProvider, check isMac
Browse files Browse the repository at this point in the history
  • Loading branch information
jwren committed Dec 2, 2024
1 parent 21bc00b commit 517ca58
Showing 1 changed file with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.EditorNotificationPanel;
Expand All @@ -20,8 +21,6 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

// TODO(devoncarew): Are we showing the 'Open in Xcode' editor action on non-mac platforms?

public class NativeEditorNotificationProvider extends EditorNotifications.Provider<EditorNotificationPanel> implements DumbAware {
private static final Key<EditorNotificationPanel> KEY = Key.create("flutter.native.editor.notification");

Expand Down Expand Up @@ -77,15 +76,15 @@ private static String getActionName(@Nullable VirtualFile root) {
// return "flutter.androidstudio.open";
//}
//else
if (root.getName().equals("ios")) {
return "flutter.xcode.open";
}
else if (root.getName().equals("macos")) {
return "flutter.xcode.open";
}
else {
return null;
if (SystemInfo.isMac) {
if (root.getName().equals("ios")) {
return "flutter.xcode.open";
}
else if (root.getName().equals("macos")) {
return "flutter.xcode.open";
}
}
return null;
}

@Nullable
Expand Down

0 comments on commit 517ca58

Please sign in to comment.