Skip to content

Add package to dependencies doesn't trigger when the dependency is the prefix for another existing dependency #5754

@FMorschel

Description

@FMorschel

Describe the bug
Currently, the extension shows a fix for depend_on_referenced_package, but I found a case that doesn't show the fix.

To Reproduce
Steps to reproduce the behavior:

  1. Add analyzer_plugin: 0.13.9 to the dependencies and create a subclass of ServerPlugin, which should ask to add missing members and one of them will use the analyzer class AnalysisContext
  2. The import it shows is from a non-direct dependency and will cause the diagnostic to trigger
  3. I believe the extension only tracks if we have a dependency where the name starts with analyzer so this case doesn't show up

Expected behavior
For the fix to show up.

Screenshots

Image

Please complete the following information:

Workspace Environment
Dart Code extension: 3.121.20250930
Flutter extension: 3.121.20250930 (activated)

App: Visual Studio Code
App Host: desktop
Version: win 1.105.1

Workspace type: Dart (LSP)
Workspace name: essential_lints

Dart (3.11.0-edge.1974c2360e1ee4345b9cb15929b1a2465559dc18): C:\Users\felip_0vh5fa6\dart
Flutter (3.35.5): C:\Users\felip_0vh5fa6\.puro\envs\stable\flutter (No device)

Output from 'dart info'

C:\Users\felip_0vh5fa6\dart\bin\dart.exe info

If providing this information as part of reporting a bug, please review the information
below to ensure it only contains things you're comfortable posting publicly.

General info

  • Dart 3.11.0-edge.1974c2360e1ee4345b9cb15929b1a2465559dc18 (main) (Mon Oct 6 18:46:13 2025 -0700) on "windows_x64"
  • on windows / "Windows 11 Pro" 10.0 (Build 26100)
  • locale is pt-BR

Project info

  • sdk constraint: '^3.9.0'
  • dependencies: analyzer_plugin
  • dev_dependencies: analyzer_testing, test, very_good_analysis

Process info

Memory CPU Elapsed time Command line
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresis bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions