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; | |
6 | |
7 import 'package:analysis_server/plugin/analysis/occurrences/occurrences_core.dar
t'; | 5 import 'package:analysis_server/plugin/analysis/occurrences/occurrences_core.dar
t'; |
8 import 'package:analysis_server/src/analysis_server.dart'; | 6 import 'package:analysis_server/src/analysis_server.dart'; |
9 import 'package:analysis_server/src/protocol_server.dart' as protocol; | 7 import 'package:analysis_server/src/protocol_server.dart' as protocol; |
10 import 'package:analyzer/exception/exception.dart'; | 8 import 'package:analyzer/exception/exception.dart'; |
11 import 'package:analyzer/src/generated/engine.dart' | 9 import 'package:analyzer/src/generated/engine.dart' |
12 show AnalysisContext, AnalysisEngine; | 10 show AnalysisContext, AnalysisEngine; |
13 import 'package:analyzer/src/generated/source.dart' show Source; | 11 import 'package:analyzer/src/generated/source.dart' show Source; |
14 | 12 |
15 /** | 13 /** |
16 * Compute all known occurrences for the given [source]. | 14 * Compute all known occurrences for the given [source]. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 List<int> offsets = _merge(existing.offsets, current.offsets); | 49 List<int> offsets = _merge(existing.offsets, current.offsets); |
52 current = new protocol.Occurrences(element, offsets, existing.length); | 50 current = new protocol.Occurrences(element, offsets, existing.length); |
53 } | 51 } |
54 elementOccurrences[element] = current; | 52 elementOccurrences[element] = current; |
55 } | 53 } |
56 | 54 |
57 static List<int> _merge(List<int> a, List<int> b) { | 55 static List<int> _merge(List<int> a, List<int> b) { |
58 return <int>[]..addAll(a)..addAll(b); | 56 return <int>[]..addAll(a)..addAll(b); |
59 } | 57 } |
60 } | 58 } |
OLD | NEW |