Flutter-intellij: Plugin does not use .analysis_options_user file

Created on 8 Nov 2016  Â·  6Comments  Â·  Source: flutter/flutter-intellij

The Flutter plugin in IntelliJ does not use the analyzer settings in
https://github.com/flutter/flutter/blob/master/.analysis_options_user

When running flutter analyze from the command line inside a Flutter project created with the IntelliJ plugin, settings from .analysis_options_user file are used.

When using a project specific .analysis_options file, IntelliJ plugin applies those settings.

Steps to Reproduce

  1. Create a new Flutter project with IntelliJ

  2. Add the following lines of code to lib/main.dart
    ```
    var list = ["hello", "world"];
    List listOfInts = list;

3. **Dart Analysis in IntelliJ does not show any warnings.**

4. **In the project folder  run `flutter analyze`.**
Since strong mode is enabled in `.analysis_options_user`, the following warning is displayed:
> flutter analyze
> Running 'flutter packages get' in learning-flutter... 432ms
> Analyzing 2 files...
> [warning] A value of type 'List<String>' can't be assigned to a variable of type 'List<int>'. (lib/HelloWorld.dart, line 2, col 24)
> (Ran in 5.8s)

5. **Create an `.analysis_options` file in the main project folder with the following content:**

analyzer:
strong-mode: true
```

  1. Dart Analysis panel will show the same warning
    > ERROR: A value of type 'List' can't be assigned to a variable of type 'List'. ([learning_flutter] lib/main.dart:4)

Flutter Doctor

[✓] Flutter (on Mac OS, channel master)
• Flutter at /Users/raju/dev/flutter
• Framework revision 57be959887 (8 hours ago), 2016-11-07 10:03:11
• Engine revision 16077d474b
• Tools Dart version 1.21.0-dev.3.0

[✓] Android toolchain - develop for Android devices (Android SDK 24.0.3)
• Android SDK at /Users/raju/Library/Android/sdk
• Platform android-24, build-tools 24.0.3
• Java(TM) SE Runtime Environment (build 1.8.0_101-b13)

[✓] iOS toolchain - develop for iOS devices (Xcode 8.1)
• XCode at /Applications/Xcode.app/Contents/Developer
• Xcode 8.1, Build version 8B62

[✓] IntelliJ IDEA Community Edition (version 2016.2.5)
• Dart plugin installed
• Flutter plugin installed

[✓] Connected devices

• Lumigon T3 • 30067719 • android-arm • Android 6.0 (API 23)

dart plugin

Most helpful comment

All 6 comments

@danrubel any idea on this one?

Addressing issues like this is part of my long arc of work to cleanup the differences between analysis server, dartanalyzer, and flutter analyze.

Great. Is there a master/meta bug we can link the individual issues like this one to?

@danrubel : is this issue better tracked elsewhere?

Fantastic!

Was this page helpful?
0 / 5 - 0 ratings