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

Side by Side Diff: pkg/analyzer/lib/file_system/file_system.dart

Issue 725143004: Format and sort analyzer and analysis_server packages. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « pkg/analyzer/lib/analyzer.dart ('k') | pkg/analyzer/lib/file_system/memory_file_system.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) 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 file_system; 5 library file_system;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analyzer/src/generated/source.dart'; 9 import 'package:analyzer/src/generated/source.dart';
10 import 'package:path/path.dart'; 10 import 'package:path/path.dart';
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 final ResourceProvider _provider; 133 final ResourceProvider _provider;
134 134
135 ResourceUriResolver(this._provider); 135 ResourceUriResolver(this._provider);
136 136
137 @override 137 @override
138 Source resolveAbsolute(Uri uri) { 138 Source resolveAbsolute(Uri uri) {
139 if (!_isFileUri(uri)) { 139 if (!_isFileUri(uri)) {
140 return null; 140 return null;
141 } 141 }
142 Resource resource = _provider.getResource(_provider.pathContext.fromUri(uri) 142 Resource resource =
143 ); 143 _provider.getResource(_provider.pathContext.fromUri(uri));
144 if (resource is File) { 144 if (resource is File) {
145 return resource.createSource(uri); 145 return resource.createSource(uri);
146 } 146 }
147 return null; 147 return null;
148 } 148 }
149 149
150 /** 150 /**
151 * Return `true` if the given URI is a `file` URI. 151 * Return `true` if the given URI is a `file` URI.
152 * 152 *
153 * @param uri the URI being tested 153 * @param uri the URI being tested
154 * @return `true` if the given URI is a `file` URI 154 * @return `true` if the given URI is a `file` URI
155 */ 155 */
156 static bool _isFileUri(Uri uri) => uri.scheme == _FILE_SCHEME; 156 static bool _isFileUri(Uri uri) => uri.scheme == _FILE_SCHEME;
157 } 157 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/analyzer.dart ('k') | pkg/analyzer/lib/file_system/memory_file_system.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698