| 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/navigation_core.dart'; | 10 import 'package:analysis_server/analysis/navigation/navigation_core.dart'; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 expect(targetFiles.single, '/testLocation.dart'); | 86 expect(targetFiles.single, '/testLocation.dart'); |
| 87 } | 87 } |
| 88 } | 88 } |
| 89 | 89 |
| 90 class TestNavigationContributor implements NavigationContributor { | 90 class TestNavigationContributor implements NavigationContributor { |
| 91 final SetAnalysisDomainTest test; | 91 final SetAnalysisDomainTest test; |
| 92 | 92 |
| 93 TestNavigationContributor(this.test); | 93 TestNavigationContributor(this.test); |
| 94 | 94 |
| 95 @override | 95 @override |
| 96 void computeNavigation(NavigationHolder holder, AnalysisContext context, | 96 void computeNavigation(NavigationCollector collector, AnalysisContext context, |
| 97 Source source, int offset, int length) { | 97 Source source, int offset, int length) { |
| 98 holder.addRegion(1, 5, ElementKind.CLASS, | 98 collector.addRegion(1, 5, ElementKind.CLASS, |
| 99 new Location('/testLocation.dart', 1, 2, 3, 4)); | 99 new Location('/testLocation.dart', 1, 2, 3, 4)); |
| 100 } | 100 } |
| 101 } | 101 } |
| 102 | 102 |
| 103 class TestSetAnalysisDomainPlugin implements Plugin { | 103 class TestSetAnalysisDomainPlugin implements Plugin { |
| 104 final SetAnalysisDomainTest test; | 104 final SetAnalysisDomainTest test; |
| 105 | 105 |
| 106 TestSetAnalysisDomainPlugin(this.test); | 106 TestSetAnalysisDomainPlugin(this.test); |
| 107 | 107 |
| 108 @override | 108 @override |
| (...skipping 14 matching lines...) Expand all Loading... |
| 123 expect(result.context, isNotNull); | 123 expect(result.context, isNotNull); |
| 124 expect(result.target, isNotNull); | 124 expect(result.target, isNotNull); |
| 125 expect(result.value, isNotNull); | 125 expect(result.value, isNotNull); |
| 126 Source source = result.target.source; | 126 Source source = result.target.source; |
| 127 test.parsedUnitFiles.add(source.fullName); | 127 test.parsedUnitFiles.add(source.fullName); |
| 128 domain.scheduleNotification( | 128 domain.scheduleNotification( |
| 129 result.context, source, AnalysisService.NAVIGATION); | 129 result.context, source, AnalysisService.NAVIGATION); |
| 130 }); | 130 }); |
| 131 } | 131 } |
| 132 } | 132 } |
| OLD | NEW |