Skip to content
Draft
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
6 changes: 3 additions & 3 deletions resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@
text="Open Flutter DevTools in Browser"
description="Open Flutter DevTools in Browser"/>
<separator/>
<!-- <action id="flutter.androidstudio.open" class="io.flutter.actions.OpenInAndroidStudioAction"-->
<!-- text="Open Android module in Android Studio"-->
<!-- description="Launch Android Studio to edit the Android module as a top-level project"/>-->
<action id="flutter.androidstudio.open" class="io.flutter.actions.OpenInAndroidStudioAction"
text="Open Android module in Android Studio"
description="Launch Android Studio to edit the Android module as a top-level project"/>
<action id="flutter.xcode.open" class="io.flutter.actions.OpenInXcodeAction"
text="Open iOS/macOS Module in Xcode"
description="Launch Xcode to edit the iOS module as a top-level project"/>
Expand Down
6 changes: 3 additions & 3 deletions src/io/flutter/actions/OpenAndroidModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/
package io.flutter.actions;

import com.android.tools.idea.gradle.project.importing.GradleProjectImporter;
import com.intellij.ide.actions.OpenFileAction;
import com.intellij.ide.impl.OpenProjectTask;
import com.intellij.openapi.actionSystem.ActionPlaces;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
Expand Down Expand Up @@ -61,8 +61,8 @@ private static void openOrImportProject(@NotNull VirtualFile projectFile,
if (canImportAsGradleProject(projectFile)) {
VirtualFile target = findGradleTarget(projectFile);
if (target != null) {
GradleProjectImporter gradleImporter = GradleProjectImporter.getInstance();
gradleImporter.importAndOpenProjectCore(null, true, projectFile);
com.intellij.ide.impl.ProjectUtil.openOrImport(projectFile.toNioPath(), OpenProjectTask.build().withForceOpenInNewFrame(forceOpenInNewFrame));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be inclined to replace this qualified name with an import statement? Or maybe there's some reason not to?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After looking into this more, I think my solution is wrong because this method openOrImport is already being imported statically and is used below. There's some additional complexity here about whether a directory should be opened as though it's a project in itself or as a sub-project, but I'm not sure what all of the consequences are. I think I'll mark this PR a draft for now.


for (Project proj : ProjectManager.getInstance().getOpenProjects()) {
if (projectFile.equals(ProjectUtil.guessProjectDir(proj)) || projectFile.equals(proj.getProjectFile())) {
if (sourceFile != null && !sourceFile.isDirectory()) {
Expand Down
Loading