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

Side by Side Diff: pkg/analysis_server/lib/src/services/index/indexable_element.dart

Issue 1409203002: Declare IndexableObject.file instead of Source. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Use filePath name. Created 5 years, 2 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
OLDNEW
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 src.services.index; 5 library src.services.index;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analysis_server/plugin/index/index_core.dart'; 9 import 'package:analysis_server/plugin/index/index_core.dart';
10 import 'package:analyzer/src/generated/element.dart'; 10 import 'package:analyzer/src/generated/element.dart';
(...skipping 27 matching lines...) Expand all
38 38
39 @override 39 @override
40 int get offset { 40 int get offset {
41 if (element is ConstructorElement) { 41 if (element is ConstructorElement) {
42 return element.enclosingElement.nameOffset; 42 return element.enclosingElement.nameOffset;
43 } 43 }
44 return element.nameOffset; 44 return element.nameOffset;
45 } 45 }
46 46
47 @override 47 @override
48 Source get source => element.source; 48 String get filePath {
49 return element.source?.fullName;
50 }
49 51
50 @override 52 @override
51 bool operator ==(Object object) => 53 bool operator ==(Object object) =>
52 object is IndexableElement && element == object.element; 54 object is IndexableElement && element == object.element;
53 55
54 @override 56 @override
55 String toString() => element.toString(); 57 String toString() => element.toString();
56 } 58 }
57 59
58 /** 60 /**
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 ClassElement classElement = element.enclosingElement; 166 ClassElement classElement = element.enclosingElement;
165 int constructorIndex = classElement.constructors.indexOf(element); 167 int constructorIndex = classElement.constructors.indexOf(element);
166 return _constructorKinds.putIfAbsent(constructorIndex, 168 return _constructorKinds.putIfAbsent(constructorIndex,
167 () => new IndexableElementKind._(ElementKind.CONSTRUCTOR)); 169 () => new IndexableElementKind._(ElementKind.CONSTRUCTOR));
168 } 170 }
169 ElementKind elementKind = element.kind; 171 ElementKind elementKind = element.kind;
170 return _kindMap.putIfAbsent( 172 return _kindMap.putIfAbsent(
171 elementKind, () => new IndexableElementKind._(elementKind)); 173 elementKind, () => new IndexableElementKind._(elementKind));
172 } 174 }
173 } 175 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/services/index/index.dart ('k') | pkg/analysis_server/lib/src/services/index/store/codec.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698