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 test.plugin.analysis_contributor; | 5 library test.plugin.analysis_contributor; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analysis_server/analysis/analysis_domain.dart'; | 9 import 'package:analysis_server/analysis/analysis_domain.dart'; |
10 import 'package:analysis_server/analysis/navigation_core.dart'; | 10 import 'package:analysis_server/analysis/navigation_core.dart'; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 } | 117 } |
118 | 118 |
119 class TestOccurrencesContributor implements OccurrencesContributor { | 119 class TestOccurrencesContributor implements OccurrencesContributor { |
120 final SetAnalysisDomainTest test; | 120 final SetAnalysisDomainTest test; |
121 | 121 |
122 TestOccurrencesContributor(this.test); | 122 TestOccurrencesContributor(this.test); |
123 | 123 |
124 @override | 124 @override |
125 void computeOccurrences( | 125 void computeOccurrences( |
126 OccurrencesCollector collector, AnalysisContext context, Source source) { | 126 OccurrencesCollector collector, AnalysisContext context, Source source) { |
127 collector.addOccurrences(new Occurrences( | 127 Element element = new Element(ElementKind.UNKNOWN, 'TestElement', 0); |
128 new Element(ElementKind.UNKNOWN, 'TestElement', 0), <int>[1, 2, 3], 5)); | 128 collector.addOccurrences(new Occurrences(element, <int>[1, 2], 5)); |
| 129 collector.addOccurrences(new Occurrences(element, <int>[3], 5)); |
129 } | 130 } |
130 } | 131 } |
131 | 132 |
132 class TestSetAnalysisDomainPlugin implements Plugin { | 133 class TestSetAnalysisDomainPlugin implements Plugin { |
133 final SetAnalysisDomainTest test; | 134 final SetAnalysisDomainTest test; |
134 | 135 |
135 TestSetAnalysisDomainPlugin(this.test); | 136 TestSetAnalysisDomainPlugin(this.test); |
136 | 137 |
137 @override | 138 @override |
138 String get uniqueIdentifier => 'test'; | 139 String get uniqueIdentifier => 'test'; |
(...skipping 17 matching lines...) Expand all Loading... |
156 expect(result.value, isNotNull); | 157 expect(result.value, isNotNull); |
157 Source source = result.target.source; | 158 Source source = result.target.source; |
158 test.parsedUnitFiles.add(source.fullName); | 159 test.parsedUnitFiles.add(source.fullName); |
159 domain.scheduleNotification( | 160 domain.scheduleNotification( |
160 result.context, source, AnalysisService.NAVIGATION); | 161 result.context, source, AnalysisService.NAVIGATION); |
161 domain.scheduleNotification( | 162 domain.scheduleNotification( |
162 result.context, source, AnalysisService.OCCURRENCES); | 163 result.context, source, AnalysisService.OCCURRENCES); |
163 }); | 164 }); |
164 } | 165 } |
165 } | 166 } |
OLD | NEW |