| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 domains.analysis.occurrences; | 5 library domains.analysis.occurrences; |
| 6 | 6 |
| 7 import 'package:analysis_server/plugin/analysis/occurrences/occurrences_core.dar
t'; | 7 import 'package:analysis_server/plugin/analysis/occurrences/occurrences_core.dar
t'; |
| 8 import 'package:analysis_server/src/analysis_server.dart'; | 8 import 'package:analysis_server/src/analysis_server.dart'; |
| 9 import 'package:analysis_server/src/protocol_server.dart' as protocol; | 9 import 'package:analysis_server/src/protocol_server.dart' as protocol; |
| 10 import 'package:analyzer/exception/exception.dart'; |
| 10 import 'package:analyzer/src/generated/engine.dart' | 11 import 'package:analyzer/src/generated/engine.dart' |
| 11 show AnalysisContext, AnalysisEngine; | 12 show AnalysisContext, AnalysisEngine; |
| 12 import 'package:analyzer/src/generated/java_engine.dart' show CaughtException; | |
| 13 import 'package:analyzer/src/generated/source.dart' show Source; | 13 import 'package:analyzer/src/generated/source.dart' show Source; |
| 14 | 14 |
| 15 /** | 15 /** |
| 16 * Compute all known occurrences for the given [source]. | 16 * Compute all known occurrences for the given [source]. |
| 17 */ | 17 */ |
| 18 OccurrencesCollectorImpl computeOccurrences( | 18 OccurrencesCollectorImpl computeOccurrences( |
| 19 AnalysisServer server, AnalysisContext context, Source source) { | 19 AnalysisServer server, AnalysisContext context, Source source) { |
| 20 OccurrencesCollectorImpl collector = new OccurrencesCollectorImpl(); | 20 OccurrencesCollectorImpl collector = new OccurrencesCollectorImpl(); |
| 21 List<OccurrencesContributor> contributors = | 21 List<OccurrencesContributor> contributors = |
| 22 server.serverPlugin.occurrencesContributors; | 22 server.serverPlugin.occurrencesContributors; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 51 List<int> offsets = _merge(existing.offsets, current.offsets); | 51 List<int> offsets = _merge(existing.offsets, current.offsets); |
| 52 current = new protocol.Occurrences(element, offsets, existing.length); | 52 current = new protocol.Occurrences(element, offsets, existing.length); |
| 53 } | 53 } |
| 54 elementOccurrences[element] = current; | 54 elementOccurrences[element] = current; |
| 55 } | 55 } |
| 56 | 56 |
| 57 static List<int> _merge(List<int> a, List<int> b) { | 57 static List<int> _merge(List<int> a, List<int> b) { |
| 58 return <int>[]..addAll(a)..addAll(b); | 58 return <int>[]..addAll(a)..addAll(b); |
| 59 } | 59 } |
| 60 } | 60 } |
| OLD | NEW |