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

Side by Side Diff: pkg/analyzer/lib/src/summary/package_bundle_reader.dart

Issue 2225893003: Provide LINE_INFO from ResynthesizerResultProvider. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
OLDNEW
1 import 'dart:io' as io; 1 import 'dart:io' as io;
2 2
3 import 'package:analyzer/dart/element/element.dart'; 3 import 'package:analyzer/dart/element/element.dart';
4 import 'package:analyzer/src/context/cache.dart'; 4 import 'package:analyzer/src/context/cache.dart';
5 import 'package:analyzer/src/context/context.dart'; 5 import 'package:analyzer/src/context/context.dart';
6 import 'package:analyzer/src/dart/element/element.dart'; 6 import 'package:analyzer/src/dart/element/element.dart';
7 import 'package:analyzer/src/generated/engine.dart'; 7 import 'package:analyzer/src/generated/engine.dart';
8 import 'package:analyzer/src/generated/java_io.dart'; 8 import 'package:analyzer/src/generated/java_io.dart';
9 import 'package:analyzer/src/generated/resolver.dart'; 9 import 'package:analyzer/src/generated/resolver.dart';
10 import 'package:analyzer/src/generated/source.dart'; 10 import 'package:analyzer/src/generated/source.dart';
11 import 'package:analyzer/src/generated/source_io.dart'; 11 import 'package:analyzer/src/generated/source_io.dart';
12 import 'package:analyzer/src/generated/utilities_dart.dart'; 12 import 'package:analyzer/src/generated/utilities_dart.dart';
13 import 'package:analyzer/src/summary/idl.dart'; 13 import 'package:analyzer/src/summary/idl.dart';
14 import 'package:analyzer/src/summary/resynthesize.dart'; 14 import 'package:analyzer/src/summary/resynthesize.dart';
15 import 'package:analyzer/src/task/dart.dart'; 15 import 'package:analyzer/src/task/dart.dart';
16 import 'package:analyzer/src/util/fast_uri.dart'; 16 import 'package:analyzer/src/util/fast_uri.dart';
17 import 'package:analyzer/task/dart.dart'; 17 import 'package:analyzer/task/dart.dart';
18 import 'package:analyzer/task/general.dart';
18 import 'package:analyzer/task/model.dart'; 19 import 'package:analyzer/task/model.dart';
19 import 'package:path/path.dart' as pathos; 20 import 'package:path/path.dart' as pathos;
20 21
21 /** 22 /**
22 * The [ResultProvider] that provides results from input package summaries. 23 * The [ResultProvider] that provides results from input package summaries.
23 */ 24 */
24 class InputPackagesResultProvider extends ResynthesizerResultProvider { 25 class InputPackagesResultProvider extends ResynthesizerResultProvider {
25 InputPackagesResultProvider( 26 InputPackagesResultProvider(
26 InternalAnalysisContext context, SummaryDataStore dataStore) 27 InternalAnalysisContext context, SummaryDataStore dataStore)
27 : super(context, dataStore) { 28 : super(context, dataStore) {
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 _dataStore.getContainingLibraryUris(uriString); 190 _dataStore.getContainingLibraryUris(uriString);
190 if (libraryUriStrings != null) { 191 if (libraryUriStrings != null) {
191 List<Source> librarySources = libraryUriStrings 192 List<Source> librarySources = libraryUriStrings
192 .map((libraryUriString) => 193 .map((libraryUriString) =>
193 context.sourceFactory.resolveUri(target, libraryUriString)) 194 context.sourceFactory.resolveUri(target, libraryUriString))
194 .toList(growable: false); 195 .toList(growable: false);
195 entry.setValue(result, librarySources, TargetedResult.EMPTY_LIST); 196 entry.setValue(result, librarySources, TargetedResult.EMPTY_LIST);
196 return true; 197 return true;
197 } 198 }
198 return false; 199 return false;
200 } else if (result == LINE_INFO) {
201 UnlinkedUnit unlinkedUnit = _dataStore.unlinkedMap[uriString];
202 List<int> lineStarts = unlinkedUnit.lineStarts;
203 if (lineStarts.isNotEmpty) {
204 LineInfo lineInfo = new LineInfo(lineStarts);
205 entry.setValue(result, lineInfo, TargetedResult.EMPTY_LIST);
206 return true;
207 }
208 return false;
199 } 209 }
200 } else if (target is LibrarySpecificUnit) { 210 } else if (target is LibrarySpecificUnit) {
201 if (result == CREATED_RESOLVED_UNIT1 || 211 if (result == CREATED_RESOLVED_UNIT1 ||
202 result == CREATED_RESOLVED_UNIT2 || 212 result == CREATED_RESOLVED_UNIT2 ||
203 result == CREATED_RESOLVED_UNIT3 || 213 result == CREATED_RESOLVED_UNIT3 ||
204 result == CREATED_RESOLVED_UNIT4 || 214 result == CREATED_RESOLVED_UNIT4 ||
205 result == CREATED_RESOLVED_UNIT5 || 215 result == CREATED_RESOLVED_UNIT5 ||
206 result == CREATED_RESOLVED_UNIT6 || 216 result == CREATED_RESOLVED_UNIT6 ||
207 result == CREATED_RESOLVED_UNIT7 || 217 result == CREATED_RESOLVED_UNIT7 ||
208 result == CREATED_RESOLVED_UNIT8 || 218 result == CREATED_RESOLVED_UNIT8 ||
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 * also provides [summaryPath]. 389 * also provides [summaryPath].
380 */ 390 */
381 class _InSummaryFallbackSource extends FileBasedSource 391 class _InSummaryFallbackSource extends FileBasedSource
382 implements InSummarySource { 392 implements InSummarySource {
383 @override 393 @override
384 final String summaryPath; 394 final String summaryPath;
385 395
386 _InSummaryFallbackSource(JavaFile file, Uri uri, this.summaryPath) 396 _InSummaryFallbackSource(JavaFile file, Uri uri, this.summaryPath)
387 : super(file, uri); 397 : super(file, uri);
388 } 398 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/protocol_server.dart ('k') | pkg/analyzer/lib/src/summary/summarize_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698