| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library computer.occurrences; | 5 library computer.occurrences; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/protocol2.dart' as protocol; | 9 import 'package:analysis_server/src/protocol.dart' as protocol; |
| 10 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
| 11 import 'package:analyzer/src/generated/element.dart'; | 11 import 'package:analyzer/src/generated/element.dart'; |
| 12 | 12 |
| 13 | 13 |
| 14 /** | 14 /** |
| 15 * A computer for elements occurrences in a Dart [CompilationUnit]. | 15 * A computer for elements occurrences in a Dart [CompilationUnit]. |
| 16 */ | 16 */ |
| 17 class DartUnitOccurrencesComputer { | 17 class DartUnitOccurrencesComputer { |
| 18 final CompilationUnit _unit; | 18 final CompilationUnit _unit; |
| 19 | 19 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 @override | 72 @override |
| 73 visitSimpleIdentifier(SimpleIdentifier node) { | 73 visitSimpleIdentifier(SimpleIdentifier node) { |
| 74 Element element = node.bestElement; | 74 Element element = node.bestElement; |
| 75 if (element != null) { | 75 if (element != null) { |
| 76 computer._addOccurrence(element, node.offset); | 76 computer._addOccurrence(element, node.offset); |
| 77 } | 77 } |
| 78 return super.visitSimpleIdentifier(node); | 78 return super.visitSimpleIdentifier(node); |
| 79 } | 79 } |
| 80 } | 80 } |
| OLD | NEW |