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

Unified Diff: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/utilities/ast/DartElementLocator.java

Issue 10447034: Fix for issue 2981 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/utilities/ast/DartElementLocator.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/utilities/ast/DartElementLocator.java (revision 8002)
+++ editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/utilities/ast/DartElementLocator.java (working copy)
@@ -424,17 +424,21 @@
if (Objects.equal(compilationUnit, library.getDefiningCompilationUnit())) {
DartImport[] imports = library.getImports();
for (DartImport imprt : imports) {
+ SourceRange uriRange = imprt.getUriRange();
scheglov 2012/05/25 17:26:36 If this variable is used only in "if", please move
Brian Wilkerson 2012/05/25 17:37:10 Done.
// on URI of library - return defining Unit of imported Library
- if (SourceRangeUtils.contains(imprt.getUriRange(), startOffset)) {
+ if (SourceRangeUtils.contains(uriRange, startOffset)) {
resolvedElement = null;
foundElement = imprt.getLibrary().getDefiningCompilationUnit();
+ wordRegion = new Region(uriRange.getOffset(), uriRange.getLength());
+ candidateRegion = new Region(0, 0);
throw new DartElementFoundException();
}
// on #import directive - return DartImport element
- if (SourceRangeUtils.contains(imprt.getSourceRange(), startOffset)) {
+ SourceRange sourceRange = imprt.getSourceRange();
+ if (SourceRangeUtils.contains(sourceRange, startOffset)) {
resolvedElement = null;
foundElement = imprt;
- SourceRange sourceRange = imprt.getSourceRange();
+ wordRegion = new Region(sourceRange.getOffset(), sourceRange.getLength());
candidateRegion = new Region(sourceRange.getOffset(), sourceRange.getLength());
throw new DartElementFoundException();
}
« 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