Skip to content

Commit

Permalink
Remove a TODO in Accessor.characterLocation (#3740)
Browse files Browse the repository at this point in the history
I looked into `nonSynthetic` and it doesn't buy us anything here. Instead, we
can just rely on analyzer's `isSynthetic` to get the right location.
  • Loading branch information
srawlins authored Apr 3, 2024
1 parent bf6080c commit a97508d
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions lib/src/model/accessor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,9 @@ class Accessor extends ModelElement {
[ExecutableMember? super.originalMember]);

@override
CharacterLocation? get characterLocation {
if (element.nameOffset < 0) {
assert(element.isSynthetic, 'Invalid offset for non-synthetic element');
// TODO(jcollins-g): switch to [element.nonSynthetic] after analyzer 1.8
return enclosingCombo.characterLocation;
}
return super.characterLocation;
}
CharacterLocation? get characterLocation => element.isSynthetic
? enclosingCombo.characterLocation
: super.characterLocation;

@override
ExecutableMember? get originalMember =>
Expand Down

0 comments on commit a97508d

Please sign in to comment.