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

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

Issue 1952683002: Resolve URIs of parts of imported libraries relative to importing library sources. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_ast_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 summary_resynthesizer; 5 library summary_resynthesizer;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after
1245 } 1245 }
1246 return <String>[referencedLibraryUri, partUri, name]; 1246 return <String>[referencedLibraryUri, partUri, name];
1247 } 1247 }
1248 LinkedDependency dependency = linkedLibrary.dependencies[dependencyIndex]; 1248 LinkedDependency dependency = linkedLibrary.dependencies[dependencyIndex];
1249 Source referencedLibrarySource = summaryResynthesizer.sourceFactory 1249 Source referencedLibrarySource = summaryResynthesizer.sourceFactory
1250 .resolveUri(librarySource, dependency.uri); 1250 .resolveUri(librarySource, dependency.uri);
1251 String referencedLibraryUri = referencedLibrarySource.uri.toString(); 1251 String referencedLibraryUri = referencedLibrarySource.uri.toString();
1252 String partUri; 1252 String partUri;
1253 if (unit != 0) { 1253 if (unit != 0) {
1254 String uri = dependency.parts[unit - 1]; 1254 String uri = dependency.parts[unit - 1];
1255 Source partSource = summaryResynthesizer.sourceFactory 1255 Source partSource =
1256 .resolveUri(referencedLibrarySource, uri); 1256 summaryResynthesizer.sourceFactory.resolveUri(librarySource, uri);
1257 partUri = partSource.uri.toString(); 1257 partUri = partSource.uri.toString();
1258 } else { 1258 } else {
1259 partUri = referencedLibraryUri; 1259 partUri = referencedLibraryUri;
1260 } 1260 }
1261 return <String>[referencedLibraryUri, partUri, name]; 1261 return <String>[referencedLibraryUri, partUri, name];
1262 } 1262 }
1263 1263
1264 /** 1264 /**
1265 * Populate a [CompilationUnitElement] by deserializing all the elements 1265 * Populate a [CompilationUnitElement] by deserializing all the elements
1266 * contained in it. 1266 * contained in it.
(...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after
2650 static String _getElementIdentifier(String name, ReferenceKind kind) { 2650 static String _getElementIdentifier(String name, ReferenceKind kind) {
2651 if (kind == ReferenceKind.topLevelPropertyAccessor || 2651 if (kind == ReferenceKind.topLevelPropertyAccessor ||
2652 kind == ReferenceKind.propertyAccessor) { 2652 kind == ReferenceKind.propertyAccessor) {
2653 if (!name.endsWith('=')) { 2653 if (!name.endsWith('=')) {
2654 return name + '?'; 2654 return name + '?';
2655 } 2655 }
2656 } 2656 }
2657 return name; 2657 return name;
2658 } 2658 }
2659 } 2659 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_ast_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698