sdk
sdk copied to clipboard
android studio parameter info and quick documentation is not fully aware of the context
@mhamri commented on Jun 21, 2018, 1:57 PM UTC:
since the flutter widgets are meant to be written inside each other, it's a must to have scope aware IDE. at moment it is showing information only about the most top level widget
This issue was moved by devoncarew from flutter/flutter#18676.
@zoechi commented on Jun 21, 2018, 2:45 PM UTC:
I think this should be moved to dart-lang/sdk. This functionality is provided by the dart_analyzer.
@mhamri commented on Jun 21, 2018, 3:04 PM UTC:
well, I believe this should somehow contribute from flutter team to dart repo, no one in right mind instantiates 100 over class inside each other. in severe case your IOC container takes care of it for you. but since its' a very special usage of the classes that flutter needs, and this strange requirement is known better by flutter developers, it will be easier to address if somehow see it as an internal problem. and again it somehow fall into the flutter tooling.
@zoechi commented on Aug 26, 2018, 5:01 PM UTC:
@devoncarew ?
@devoncarew commented on Aug 27, 2018, 4:53 AM UTC:
Yup, I agree, this is likely an issue with the analysis server - will move repos.
cc @scheglov
The way it is supposed to work is that Analysis Server returns completions, and each completion has location - file and offset. When the user selects a completion, IDE requests analysis.getHover at this location.
For Row there is a complication - its constructor parameters are named, but are not "field formal parameters", so don't have fields associated with them, and so don't have element, and so no location. So, when I try to request documentation for completion items in Row, I get nothing. Which is not perfect - the user does not get any information how to use these parameters.
Ah, actually I can reproduce something like this, just not in completion. If I ask quick documentation on new or new Row() I actually see that IntelliJ gives Analysis Server the offset of new MaterialApp() instead. So, I guess it is not a bug in Analysis Server, but in Dart plugin. @jwren might provide link to the corresponding Dart plugin issue.
As @scheglov wrote I do not get any documentation at all for Row parameters in the completion list. I'm afraid I have no idea how to reproduce the screenshot in this issue description.
BTW I get the correct docs in similar cases:

When caret is on Row in new Row() you get docs for Row as expected. But @scheglov is right that if the caret is on new in new Row() then you get docs for MaterialApp instead. IMO this is a minor issue.
Any clues how to reproduce the bigger issue (from the original screenshot) are welcome.
I've got the same problem with Android Studio Build #AI-241.15989.150.2411.11948838, built on June 10, 2024
