flutter / flutter-intellij

Flutter Plugin for IntelliJ
https://flutter.dev/using-ide
BSD 3-Clause "New" or "Revised" License
1.98k stars 319 forks source link

todo not working #2912

Open dark-chocolate opened 5 years ago

dark-chocolate commented 5 years ago

Steps to Reproduce

When you type todo in Android Studio, it doesn't create a todo automatically. I have to type // todo to make it work.

Flutter doctor

[✓] Flutter (Channel beta, v1.0.0, on Mac OS X 10.14 18A389, locale en-GB) [✓] Android toolchain - develop for Android devices (Android SDK 28.0.3) [✓] iOS toolchain - develop for iOS devices (Xcode 10.1) [✓] Android Studio (version 3.2) [✓] Connected device (1 available)

• No issues found!

stevemessick commented 5 years ago

This is working as intended. The string "todo" isn't scanned everywhere, just as the first part of a comment. If you'd like to get this changed I suggest you file an issue in the dart-lang repository: https://youtrack.jetbrains.com/issues/WEB?q=Subsystem:%20Dart

dark-chocolate commented 5 years ago

But in Android studio, when I code in Java, writing todo creates a comment automatically. Why that is not the case here in Flutter? And what did you mean by working as intended? I am creating an issue there too but that team is too lazy, I have filled up issues there in the past, no one responds at all. Here is the link

https://youtrack.jetbrains.com/issue/WEB-36196

alexander-doroshko commented 5 years ago

I am creating an issue there too but that team is too lazy, I have filled up issues there in the past, no one responds at all

@dark-chocolate I'd disagree. See your previous issue. You've got a response in less than 2 hours (it was a week ago) and now it's your turn :)

stevemessick commented 5 years ago

Sorry! I didn't know about the AndroidComments live template. You can enable it for Flutter and Dart by adding Dart to the list of applicable elements. Click the Change button near the bottom of the preferences/settings page:

screen shot 2018-12-05 at 8 32 46 am

@devoncarew @pq This is a pretty cool feature. We should consider enabling it by default, and if not, making it more discoverable. This is defined by IntelliJ, not Android Studio.

alexander-doroshko commented 5 years ago

@stevemessick, this is defined in AndroidComments.xml file, which is among Android Studio sources and therefore also in Android plugin for IntelliJ sources.

dark-chocolate commented 5 years ago

Thank you @stevemessick , it is working now. Love your support and help. Many thanks

stevemessick commented 5 years ago

@alexander-doroshko, what I meant was that if we want to enable this by default it can be done in the base Flutter plugin since it is available in IntelliJ CE, at least if you make an Android project. (I didn't check Java.) Thanks for the clarification.

And I'm going to re-open this so we remember to talk about it at some point.

stevemessick commented 5 years ago

And thanks @dark-chocolate for reporting this. I kinda like it, now that I know about it.

alexander-doroshko commented 5 years ago

Speaking of technical details, I'm not sure Dart/Flutter plugins can add supported contexts to Live Templates defined in the Android plugin. But Dart/Flutter plugins definitely can have own set of predefined templates (and already have some), and these templates may have the same abbreviations (but different context).