Skip to content

Code completion doesn't suggest from dev_dependencies, but manually referencing classes does not generate errors/warnings #42873

@DanTup

Description

@DanTup

I had reports of code completion missing some classes that were valid in the current scope, for example Provider here:

Screenshot 2020-07-29 at 14 51 10

It turned out that the provider package was listed in dev_dependencies and it seems like these should not be used in the lib folder:

/// With `Pub`, files below the `pubspec.yaml` file can access libraries
/// of packages listed as `dependencies`, and files in the `test` directory
/// can in addition access libraries of packages listed as `dev_dependencies`.

However, typing these classes manually does not generate any warnings/errors, and as far as I can tell there is no lint for this.

If it's not valid to import dev_dependencies into lib, it seems like an error/warning should be generated? If it is, then it seems like they should be included in completion?

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestlegacy-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