Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit cecda90

Browse files
bwilkersoncommit-bot@chromium.org
authored andcommitted
Update analyzer docs based on previous feedback
Change-Id: I165ac4b816f5dc2c244e53387436dd2409774557 Reviewed-on: https://dart-review.googlesource.com/c/80940 Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Brian Wilkerson <[email protected]>
1 parent ab6eb93 commit cecda90

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

pkg/analyzer/doc/tutorial/element.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ code is modeled by the [AST][ast].
77
Generally speaking, an element represents something that is declared in the
88
code, such as a class, method, or variable. Elements can be explicitly declared,
99
such as the class defined by a class declaration, or implicitly declared, such
10-
as the default constructor defined for concrete classes that do not have any
11-
explicit constructor declarations.
10+
as the default constructor defined for classes that do not have any explicit
11+
constructor declarations. Elements that are implicitly declared are referred to
12+
as _synthetic_ elements.
1213

1314
There are a few elements that represent entities that are not declared. For
1415
example, there is an element representing a compilation unit (`.dart` file) and
@@ -45,7 +46,7 @@ ask the analysis session for the compilation unit representing that file.
4546

4647
```dart
4748
analyzeSingleFile(AnalysisSession session, String path) async {
48-
UnitElementResult result = await session.UnitElementResult(path);
49+
UnitElementResult result = await session.getUnitElement(path);
4950
CompilationUnitElement element = result.element;
5051
}
5152
```

0 commit comments

Comments
 (0)