Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(305)

Side by Side Diff: pkg/analysis_services/lib/src/index/store/codec.dart

Issue 428303004: Breaking changes in 'analyzer' package. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rename Source.resolveRelative to resolveRelativeUri, soften version constraints Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 services.src.index.store.codec; 5 library services.src.index.store.codec;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analysis_services/index/index.dart'; 9 import 'package:analysis_services/index/index.dart';
10 import 'package:analysis_services/src/index/store/collection.dart'; 10 import 'package:analysis_services/src/index/store/collection.dart';
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 } 167 }
168 168
169 /** 169 /**
170 * Returns an approximation of the given {@link Element}'s location. 170 * Returns an approximation of the given {@link Element}'s location.
171 */ 171 */
172 List<int> _getLocationPathLimited(Element element) { 172 List<int> _getLocationPathLimited(Element element) {
173 List<String> components = element.location.components; 173 List<String> components = element.location.components;
174 int length = components.length; 174 int length = components.length;
175 String firstComponent = components[0]; 175 String firstComponent = components[0];
176 String lastComponent = components[length - 1]; 176 String lastComponent = components[length - 1];
177 firstComponent = firstComponent.substring(1);
178 lastComponent = _substringBeforeAt(lastComponent); 177 lastComponent = _substringBeforeAt(lastComponent);
179 int firstId = _stringCodec.encode(firstComponent); 178 int firstId = _stringCodec.encode(firstComponent);
180 int lastId = _stringCodec.encode(lastComponent); 179 int lastId = _stringCodec.encode(lastComponent);
181 return <int>[firstId, lastId]; 180 return <int>[firstId, lastId];
182 } 181 }
183 182
184 bool _hasLocalOffset(List<String> components) { 183 bool _hasLocalOffset(List<String> components) {
185 for (String component in components) { 184 for (String component in components) {
186 if (component.indexOf('@') != -1) { 185 if (component.indexOf('@') != -1) {
187 return true; 186 return true;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 int encode(String name) { 244 int encode(String name) {
246 int index = nameToIndex[name]; 245 int index = nameToIndex[name];
247 if (index == null) { 246 if (index == null) {
248 index = _indexToName.length; 247 index = _indexToName.length;
249 nameToIndex[name] = index; 248 nameToIndex[name] = index;
250 _indexToName.add(name); 249 _indexToName.add(name);
251 } 250 }
252 return index; 251 return index;
253 } 252 }
254 } 253 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/analysis_abstract.dart ('k') | pkg/analysis_services/test/index/store/codec_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698