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

Side by Side Diff: pkg/analysis_server/lib/src/services/completion/dart/uri_contributor.dart

Issue 1513453002: fix uri contributor for Windows (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 | no next file » | 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.completion.contributor.dart.importuri; 5 library services.completion.contributor.dart.importuri;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:core' hide Resource; 8 import 'dart:core' hide Resource;
9 9
10 import 'package:analysis_server/src/provisional/completion/dart/completion_dart. dart'; 10 import 'package:analysis_server/src/provisional/completion/dart/completion_dart. dart';
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 114
115 String dirPath = resContext.normalize(parentUri); 115 String dirPath = resContext.normalize(parentUri);
116 if (resContext.isRelative(dirPath)) { 116 if (resContext.isRelative(dirPath)) {
117 String sourceDirPath = resContext.dirname(source.fullName); 117 String sourceDirPath = resContext.dirname(source.fullName);
118 if (resContext.isAbsolute(sourceDirPath)) { 118 if (resContext.isAbsolute(sourceDirPath)) {
119 dirPath = resContext.join(sourceDirPath, dirPath); 119 dirPath = resContext.join(sourceDirPath, dirPath);
120 } else { 120 } else {
121 return; 121 return;
122 } 122 }
123 } 123 }
124 if (dirPath.endsWith('\\.')) {
125 dirPath = dirPath.substring(0, dirPath.length - 1);
126 }
124 127
125 Resource dir = resProvider.getResource(dirPath); 128 Resource dir = resProvider.getResource(dirPath);
126 if (dir is Folder) { 129 if (dir is Folder) {
127 for (Resource child in dir.getChildren()) { 130 for (Resource child in dir.getChildren()) {
128 String completion; 131 String completion;
129 if (child is Folder) { 132 if (child is Folder) {
130 completion = '$uriPrefix${child.shortName}/'; 133 completion = '$uriPrefix${child.shortName}/';
131 } else { 134 } else {
132 completion = '$uriPrefix${child.shortName}'; 135 completion = '$uriPrefix${child.shortName}';
133 } 136 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 } 180 }
178 181
179 String _extractPartialUri(SimpleStringLiteral node) { 182 String _extractPartialUri(SimpleStringLiteral node) {
180 if (request.offset < node.contentsOffset) { 183 if (request.offset < node.contentsOffset) {
181 return null; 184 return null;
182 } 185 }
183 return node.literal.lexeme.substring( 186 return node.literal.lexeme.substring(
184 node.contentsOffset - node.offset, request.offset - node.offset); 187 node.contentsOffset - node.offset, request.offset - node.offset);
185 } 188 }
186 } 189 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698