Repository navigation
[flutter_tools] Support IntelliJ 2020.1 and later on Linux and Windows - #58853
Conversation
46e0293 to
8dc16ed
Compare
|
Hi @jparound30 , This is a really well written PR, and with good test coverage too. I'm sorry it took so long to get to reviewing it, but we were a bit stuck on what our plans for the IDE validators are. After discussing it for a while, it sounds like we're going to drop the IDE validation all together. It was proving to be a lot of work to maintain, and was often giving users the impression that they needed to use Android Studio/Intellij/VsCode - which isn't the case today. Since we're going to turn down the feature, we can't merge this PR. I'm sorry that we didn't get to this one sooner, but I really appreciate the effort you put into it and I would love to see more contributions from you in the future. |
|
Hi @jparound30 We've backtracked a bit and we're still going to support IDE validators. If you are willing to rebase and update I'm happy to review and help you land this |
8dc16ed to
5d19dbb
Compare
82ec72d to
41d4f51
Compare
41d4f51 to
26c9c08
Compare
|
Thank you for giving me the opportunity! |
|
That is great to hear! I will take a look first thing in the morning 😄 |
jonahwilliams
left a comment
There was a problem hiding this comment.
Just some minor style nits, otherwise this looks great.
| String installPath; | ||
| try { | ||
| installPath = fileSystem.file(fileSystem.path.join(dir.path, '.home')).readAsStringSync(); | ||
| } on Exception { |
There was a problem hiding this comment.
nit: only catch the specific exception type thrown by the file system.
| } on Exception { | |
| } on FileSystemException{ |
|
|
||
| // after IntelliJ 2020 | ||
| final Directory cacheDir = fileSystem.directory(fileSystem.path.join(platform.environment['LOCALAPPDATA'], 'JetBrains')); | ||
| if (cacheDir.existsSync()) { |
There was a problem hiding this comment.
since there are not validators added after this check, you could reduce some of the nesting here by doing an early return.
if (!cachedir.existsSync()) {
return validators;
}
| // IntelliJ 2020.3 | ||
| pluginsPath = installPath + '.plugins'; | ||
| addValidator(title, version, installPath, pluginsPath); | ||
| } else if (fileSystem.isDirectorySync(fileSystem.path.join(platform.environment['APPDATA'], 'JetBrains', name, 'plugins'))) { |
There was a problem hiding this comment.
nit: pull out the value into a local like appData and reuse it.
| } | ||
| // after IntelliJ 2020 ~ | ||
| final Directory cacheDir = fileSystem.directory(fileSystem.path.join(fileSystemUtils.homeDirPath, '.cache', 'JetBrains')); | ||
| if (cacheDir.existsSync()) { |
There was a problem hiding this comment.
Same general comments here as above
| /// in another JAR. | ||
| const String kIntellijFlutterPluginXml = r''' | ||
| void createIntellijFlutterPluginJar(String pluginJarPath, FileSystem fileSystem, {String version = '0.1.3'}) { | ||
| /// These file contents were derived from the META-INF/plugin.xml from an Intellij Flutter |
There was a problem hiding this comment.
I would leave this as a doc comment and place this on the method itself, maybe with an additional first sentence like "a helper to create a flutter plugin jar XML string"
| /// in another JAR. | ||
| const String kIntellijDartPluginXml = r''' | ||
| void createIntellijDartPluginJar(String pluginJarPath, FileSystem fileSystem) { | ||
| /// These file contents were derived from the META-INF/plugin.xml from an Intellij Dart |
|
Landed! Thank you so much @jparound30 |
Description
Even after PR #57963 merged, Flutter tools do not recognize IntelliJ IDEA/Community 2020.1 on Linux and Windows.
This PR will update IntelliJ IDEA/Community validation logic for 2020.1 and later on Linux and Windows.
Related Issues
Ref: #57963
Ref: #57684
Ref: #54867
Ref: #58384
Tests
I added the following tests:
packages/flutter_tools/test/general.shard/intellij/intellij_validator_test.dartChecklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read [Handling breaking changes].