Files
sdk/pkg/analyzer/lib
Konstantin Shcheglov ba9923c406 DeCo. Add ScopeContext.visitDocumentationComment
Centralize documentation comment traversal in ScopeContext so that all
declarations visit doc comments under a consistent
DocumentationCommentScope.

The new helper temporarily rebinds the doc-import scope’s inner scope to
the current name scope, assigns the comment’s nameScope, and then visits
the comment. This preserves correct resolution of identifiers referenced
from documentation comments while avoiding duplicated scope plumbing.

As part of the refactor:
- Remove per-call visitDocumentationComment overrides from ScopeContext’s
  declaration visitors.
- Delete ScopeResolverVisitor’s private _visitDocumentationComment helper
  and ScopeContext.withDocImportScope.
- Update all resolver call sites to route doc-comment visits through the
  new ScopeContext API.

Change-Id: Iffbefb03cf5f61b61144a9f3a9cfc85b4df10491
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482981
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-02-23 18:10:40 -08:00
..