Skip to content

Alternative for deprecated MethodElement.computeNode() method in analyzerΒ #36654

@jorgecoca

Description

@jorgecoca

Thank you for taking the time to file an issue!

In order to route, prioritize, and act on this, please include:

  • Dart SDK Version (2.2.0)
  • macOS

In this commit, some of the contents of pkg/analyzer/lib/dart/element/element.dart were annotated as @deprecated; however, the documentation does not seem to suggest any alternatives.

I used to use computeNode(), from the class MethodElement, to retrieve the body implementation of a MethodElement as follows:

final commonBody = methodElement.computeNode().body;

but not the analyzer is marking it as deprecated, so I would like to understand what is the alternative for this use case.

PS. To give some more context, this is part of a code generator (using source_gen) that is parsing the contents of files annotated with certain metadata.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestanalyzer-apiIssues that impact the public API of the analyzer packagearea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.dart-model-analyzer-packageIssues related to package:analyzertype-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