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

Unified Diff: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/info/DartVariableInfo.java

Issue 9977007: Remember visibility range for DartVariable (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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
Index: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/info/DartVariableInfo.java
diff --git a/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/info/DartVariableInfo.java b/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/info/DartVariableInfo.java
index 68ff9255836427b8fc0dced96bb0a48c9ec974c5..7a6040cb260f63475f130398f8a8efb9bbcfc9cf 100644
--- a/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/info/DartVariableInfo.java
+++ b/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/info/DartVariableInfo.java
@@ -13,6 +13,9 @@
*/
package com.google.dart.tools.core.internal.model.info;
+import com.google.dart.tools.core.internal.model.SourceRangeImpl;
+import com.google.dart.tools.core.model.SourceRange;
+
/**
* Instances of the class <code>DartVariableInfo</code> maintain the cached data shared by all equal
* variables.
@@ -29,6 +32,9 @@ public class DartVariableInfo extends DeclarationElementInfo {
*/
private boolean isParameter;
+ private int visibleStart;
+ private int visibleEnd;
+
/**
* Return the name of the declared type of this variable, or <code>null</code> if this variable
* does not have a declared type.
@@ -40,6 +46,13 @@ public class DartVariableInfo extends DeclarationElementInfo {
}
/**
+ * @return the {@link SourceRange} in which this variable is visible.
+ */
+ public SourceRange getVisibleRange() {
+ return new SourceRangeImpl(visibleStart, visibleEnd - visibleStart + 1);
+ }
+
+ /**
* Return <code>true</code> if this variable is a parameter.
*
* @return <code>true</code> if this variable is a parameter
@@ -65,4 +78,18 @@ public class DartVariableInfo extends DeclarationElementInfo {
public void setTypeName(char[] name) {
typeName = name;
}
+
+ /**
+ * Sets the end of source range in which this variable is visible.
+ */
+ public void setVisibleEnd(int visibleEnd) {
+ this.visibleEnd = visibleEnd;
+ }
+
+ /**
+ * Sets the start of source range in which this variable is visible.
+ */
+ public void setVisibleStart(int visibleStart) {
+ this.visibleStart = visibleStart;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698