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

Side by Side Diff: pkg/analyzer/lib/src/generated/sdk_io.dart

Issue 1715003002: Different approach to fixing file to URI mapping. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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) 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 analyzer.src.generated.sdk_io; 5 library analyzer.src.generated.sdk_io;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 String path = library.shortName; 463 String path = library.shortName;
464 try { 464 try {
465 return new FileBasedSource(file, parseUriWithException(path)); 465 return new FileBasedSource(file, parseUriWithException(path));
466 } on URISyntaxException catch (exception, stackTrace) { 466 } on URISyntaxException catch (exception, stackTrace) {
467 AnalysisEngine.instance.logger.logInformation( 467 AnalysisEngine.instance.logger.logInformation(
468 "Failed to create URI: $path", 468 "Failed to create URI: $path",
469 new CaughtException(exception, stackTrace)); 469 new CaughtException(exception, stackTrace));
470 return null; 470 return null;
471 } 471 }
472 } 472 }
473 } 473 libraryPath = new JavaFile(library.path).getParent();
474 for (SdkLibrary library in _libraryMap.sdkLibraries) {
475 String libraryPath = new JavaFile(library.path).getParent();
476 if (filePath.startsWith("$libraryPath${JavaFile.separator}")) { 474 if (filePath.startsWith("$libraryPath${JavaFile.separator}")) {
477 String path = 475 String path =
478 "${library.shortName}/${filePath.substring(libraryPath.length + 1)}" ; 476 "${library.shortName}/${filePath.substring(libraryPath.length + 1)}" ;
479 try { 477 try {
480 return new FileBasedSource(file, parseUriWithException(path)); 478 return new FileBasedSource(file, parseUriWithException(path));
481 } on URISyntaxException catch (exception, stackTrace) { 479 } on URISyntaxException catch (exception, stackTrace) {
482 AnalysisEngine.instance.logger.logInformation( 480 AnalysisEngine.instance.logger.logInformation(
483 "Failed to create URI: $path", 481 "Failed to create URI: $path",
484 new CaughtException(exception, stackTrace)); 482 new CaughtException(exception, stackTrace));
485 return null; 483 return null;
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 SdkLibrariesReader_LibraryBuilder libraryBuilder = 663 SdkLibrariesReader_LibraryBuilder libraryBuilder =
666 new SdkLibrariesReader_LibraryBuilder(_useDart2jsPaths); 664 new SdkLibrariesReader_LibraryBuilder(_useDart2jsPaths);
667 // If any syntactic errors were found then don't try to visit the AST 665 // If any syntactic errors were found then don't try to visit the AST
668 // structure. 666 // structure.
669 if (!errorListener.errorReported) { 667 if (!errorListener.errorReported) {
670 unit.accept(libraryBuilder); 668 unit.accept(libraryBuilder);
671 } 669 }
672 return libraryBuilder.librariesMap; 670 return libraryBuilder.librariesMap;
673 } 671 }
674 } 672 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/sdk.dart ('k') | pkg/analyzer/test/generated/all_the_rest_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698