Skip to content

Deprecated libraries and completion #61214

@FMorschel

Description

@FMorschel

In the SDK, I found a deprecated library which had a similar case to the following:

@Deprecated('Deprecated library')
library;

class MyDeprecatedClass {}

It was then exported by another library, like (consider it other.dart):

// ignore: deprecated_member_use_from_same_package
export 'deprecated.dart';

And when I had the last library already imported, no diagnostic was shown but I could still see the strokes on the completion:

Image

IRL, the files were:

  • Deprecated pkg/analyzer/lib/src/error/codes.g.dart
  • Exporter pkg/analyzer/lib/src/error/codes.dart
  • Importer pkg/analysis_server/lib/src/services/correction/fix_internal.dart

The deprecated library had this under deprecated:

  // This library is deprecated to prevent it from being accidentally imported
  // It should only be imported by the corresponding non-code-generated library
  // (which suppresses the deprecation warning using an "ignore" comment).
  'Use package:analyzer/src/error/codes.dart instead',

But as you can see, it still feels a bit weird if you look at the completion.

My question would be if we should stop showing deprecated for completions because the declaring library is deprecated?

CC @bwilkerson @DanTup

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-completionIssues with the analysis server's code completion featuretype-uxA user experience or user interface related issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions