Skip to content

[flutter_tools] Support latest IntelliJ via Jetbrain toolbox - #57963

Merged
jmagman merged 7 commits into
flutter:masterfrom
Nash0x7E2:nash/jetbrains-toolbox
May 27, 2020
Merged

jmagman merged 7 commits into
flutter:masterfrom
Nash0x7E2:nash/jetbrains-toolbox

Conversation

@Nash0x7E2

Copy link
Copy Markdown
Contributor

Description

Flutter tools do not recognize the plugin directory of IntelliJ IDEA 2020.1 (installed via Jetbrains Toolbox).

This PR updates the _pluginsPath to support the plugins subdirectory used by Jetbrains Toolbox.

Related Issues

Ref: #47583
Ref: #57642

Tests

Existing test passing

Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I signed the [CLA].
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

  • No, no existing tests failed, so this is not a breaking change.

@fluttergithubbot fluttergithubbot added the tool Affects the "flutter" command-line tool. See also t: labels. label May 25, 2020
@fluttergithubbot

Copy link
Copy Markdown
Contributor

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@jmagman jmagman added the t: flutter doctor Problem related to the "flutter doctor" tool label May 26, 2020
@jmagman
jmagman requested a review from christopherfujino May 26, 2020 21:42
Comment thread packages/flutter_tools/lib/src/doctor.dart Outdated
Comment thread packages/flutter_tools/lib/src/doctor.dart Outdated
@Nash0x7E2

Copy link
Copy Markdown
Contributor Author

Thanks for the suggestions @jmagman. I've added the changes you requested 🙂

if (split.length < 2) {
return null;
}
final int major = int.parse(split[0]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why did you parse these into ints?

@jmagman jmagman May 26, 2020 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These lines were moved from line 923. Not the best way to do it, but that's how it was done before.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I used it to check the major and minor version numbers. It was simpler to compare these as int since the can be easily converted back to strings.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh wait @christopherfujino is right, I totally misread this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right, in the previous version I used an if to check the version numbers. I think the ints can be removed now since they are not used. Can I push an update to this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can revert them back to Strings now that you aren't actually checking if it's > 2020

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ahh, again demonstrating the difficulty of reviewing different versions of a PR on github. Thanks for updating, @Nash0x7E2

@jmagman

jmagman commented May 26, 2020

Copy link
Copy Markdown
Member

It would be awesome to get some tests for the plugins directory logic, and we don't have any currently. You mind if I push some to your fork?

@Nash0x7E2

Copy link
Copy Markdown
Contributor Author

@jmagman sure, go for it

@@ -1,38 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The original intellij plugins path checking on mac tests thought they were using these two Info.plists, but they actually weren't...
Unused, delete.

@christopherfujino christopherfujino left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM with a nit to add a comment documenting why we have two paths

'$id$major.$minor',
'plugins',
);
if (!globals.fs.isDirectorySync(pluginsPath)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

could we add a comment here to explain why we have two paths?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍 I had suggested a comment in #57963 (comment)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Code updated with comment 👍

@ovestoerholt

Copy link
Copy Markdown

Does not work for me with Flutter 1.22.1 (neither did it work on earlier versions...)

flutter doctor 
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.1, on Mac OS X 10.15.7 19H2, locale nb-NO)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
[!] Android Studio (version 4.0)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[!] Android Studio (version 4.1)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[!] Android Studio
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[!] Android Studio
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    ✗ Android Studio not found at /Users/ovestorholt/Library/Application
      Support/JetBrains/Toolbox/apps/AndroidStudio/ch-2/193.6453388/Android Studio 4.0 Preview.app/Contents
[!] Android Studio
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    ✗ Android Studio not found at /Users/ovestorholt/Library/Application
      Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/202.6811877/Android Studio 4.2 Preview.app/Contents
[!] IntelliJ IDEA Ultimate Edition (version 2020.2.3)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.49.2)
[✓] Connected device (2 available)

@ozzy1873

Copy link
Copy Markdown

Same problem here with v1.22.1

@jmagman

jmagman commented Oct 15, 2020 •

Copy link
Copy Markdown
Member

Please file new issues and completely fill out the template so we can triage instead of commenting on merged PRs. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t: flutter doctor Problem related to the "flutter doctor" tool tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants