dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.31k stars 1.59k forks source link

[analyzer] doesn't show import for ../../models/bar.dart #37537

Open lukepighetti opened 5 years ago

lukepighetti commented 5 years ago

Dart analyzer doesn't appear to be able to walk down to a parent directory and then into a child directory.

eg

lib/screens/foo/foo.dart
lib/models/bar.dart

if you try to import Bar() from inside foo.dart, the only option given by the analyzer (via VSCode auto complete) is to import the package

import 'package:myapp/models/bar.dart';

This import then gets mixed in with all the other package imports instead of being next to the other relative imports

Ideally it would be able to do the following

import '../../models/bar.dart'

FMorschel commented 2 months ago

This issue has already been resolved. Tested on latest stable. Are you still seeing this?