Skip to content

Variable hover should show the origin of the given type #56350

Closed
@FMorschel

Description

@FMorschel

I was instructed by DanTup to post this issue here as well. The original is fully described below:

From Dart-Code/Dart-Code#5206

Describe the problem
Variable hover should show the origin of the given type.

This is pretty important in cases where there are types with the same name and they don't have any relation to one another like the sample, but I also see significance if they extend one another and they are inverted in some way.

This would also help if the variables are not directly created like this but actually returned from different functions and is not clear which of them is being returned.

To Reproduce

Sample:

main.dart

import 'a.dart' as a;

void main() {
  final aFromA = a.A();
  final list = [A(), A(), A()];
  for (final value in list) {
    
  }
}

class A {}

a.dart

class A {}

Steps to reproduce the behavior:

  1. Create an empty project and add both files.
  2. Hover over the aFromA variable
  3. Hover over value variable
  4. Hover over list variable

What happens in all of these cases is displayed below in the screenshot session.

Expected behavior
I expected the type hover to differentiate between A from the main.dart file and from a.dart file.

Screenshots
image
image
image

Aditional info
This info is already shown if you hover the actual constructor.

image
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestdevexp-hoverIssues related to hoverslegacy-area-analyzerUse area-devexp instead.type-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions