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

Side by Side Diff: pkg/analysis_server/lib/src/services/correction/util.dart

Issue 1135073004: Fix for 'Create part' Quick Fix. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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/analysis_server/lib/src/services/refactoring/move_file.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 services.src.correction.util; 5 library services.src.correction.util;
6 6
7 import 'dart:math'; 7 import 'dart:math';
8 8
9 import 'package:analysis_server/src/protocol.dart' 9 import 'package:analysis_server/src/protocol.dart'
10 show SourceChange, SourceEdit; 10 show SourceChange, SourceEdit;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 /** 98 /**
99 * Attempts to convert the given absolute path into an absolute URI, such as 99 * Attempts to convert the given absolute path into an absolute URI, such as
100 * "dart" or "package" URI. 100 * "dart" or "package" URI.
101 * 101 *
102 * [context] - the [AnalysisContext] to work in. 102 * [context] - the [AnalysisContext] to work in.
103 * [path] - the absolute path, not `null`. 103 * [path] - the absolute path, not `null`.
104 * 104 *
105 * Returns the absolute (non-file) URI or `null`. 105 * Returns the absolute (non-file) URI or `null`.
106 */ 106 */
107 String findAbsoluteUri(AnalysisContext context, String path) { 107 String findAbsoluteUri(AnalysisContext context, String path) {
108 Source fileSource = new NonExistingSource(path, UriKind.FILE_URI); 108 Source fileSource = new NonExistingSource(path, null, UriKind.FILE_URI);
109 Uri uri = context.sourceFactory.restoreUri(fileSource); 109 Uri uri = context.sourceFactory.restoreUri(fileSource);
110 if (uri == null) { 110 if (uri == null) {
111 return null; 111 return null;
112 } 112 }
113 return uri.toString(); 113 return uri.toString();
114 } 114 }
115 115
116 /** 116 /**
117 * Returns the EOL to use for the given [code]. 117 * Returns the EOL to use for the given [code].
118 */ 118 */
(...skipping 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after
1558 1558
1559 @override 1559 @override
1560 Object visitExpression(Expression node) { 1560 Object visitExpression(Expression node) {
1561 if (node is BinaryExpression && node.operator.type == groupOperatorType) { 1561 if (node is BinaryExpression && node.operator.type == groupOperatorType) {
1562 return super.visitNode(node); 1562 return super.visitNode(node);
1563 } 1563 }
1564 operands.add(node); 1564 operands.add(node);
1565 return null; 1565 return null;
1566 } 1566 }
1567 } 1567 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/refactoring/move_file.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698