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

Side by Side Diff: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/actions/DeployConsolePatternMatcher.java

Issue 439933005: first incremental cut at editor without packages directories (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012, the Dart project authors. 2 * Copyright (c) 2012, the Dart project authors.
3 * 3 *
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except
5 * in compliance with the License. You may obtain a copy of the License at 5 * in compliance with the License. You may obtain a copy of the License at
6 * 6 *
7 * http://www.eclipse.org/legal/epl-v10.html 7 * http://www.eclipse.org/legal/epl-v10.html
8 * 8 *
9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License 9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 233
234 /** 234 /**
235 * Given "package:web_ui/dwc.dart", return "/Users/foo/dart/sample/packages/we b_ui/dwc.dart". 235 * Given "package:web_ui/dwc.dart", return "/Users/foo/dart/sample/packages/we b_ui/dwc.dart".
236 * 236 *
237 * @param packageUrl 237 * @param packageUrl
238 * @return 238 * @return
239 */ 239 */
240 private String resolvePackageUrl(String packageUrl) { 240 private String resolvePackageUrl(String packageUrl) {
241 String urlSnippet = packageUrl.substring("package:".length()); 241 String urlSnippet = packageUrl.substring("package:".length());
242 242
243 //TODO (danrubel): map package reference to packages returned by pub-list wh en packages
244 // directory does not exist AND when pubspec is not in project folder
243 for (IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects ()) { 245 for (IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects ()) {
244 IFolder packagesDir = project.getFolder(DartCore.PACKAGES_DIRECTORY_NAME); 246 IFolder packagesDir = project.getFolder(DartCore.PACKAGES_DIRECTORY_NAME);
245 247
246 if (packagesDir.exists()) { 248 if (packagesDir.exists()) {
247 IFile file = packagesDir.getFile(urlSnippet); 249 IFile file = packagesDir.getFile(urlSnippet);
248 250
249 if (file.exists() && file.isAccessible()) { 251 if (file.exists() && file.isAccessible()) {
250 return file.getLocation().toPortableString(); 252 return file.getLocation().toPortableString();
251 } 253 }
252 } 254 }
(...skipping 13 matching lines...) Expand all
266 } 268 }
267 269
268 private String stripParens(String str) { 270 private String stripParens(String str) {
269 if (str.startsWith("(") && str.endsWith(")")) { 271 if (str.startsWith("(") && str.endsWith(")")) {
270 return str.substring(1, str.length() - 1); 272 return str.substring(1, str.length() - 1);
271 } else { 273 } else {
272 return str; 274 return str;
273 } 275 }
274 } 276 }
275 } 277 }
OLDNEW
« no previous file with comments | « editor/tools/plugins/com.google.dart.tools.search/src/com/google/dart/tools/search/ui/text/TextSearchScopeFilter.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698