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

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

Issue 11312081: Issue 6251. Resolve and rename [id] references in documentation comments (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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_test/src/com/google/dart/tools/core/utilities/ast/DartElementLocatorTest.java
diff --git a/editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/utilities/ast/DartElementLocatorTest.java b/editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/utilities/ast/DartElementLocatorTest.java
index 131a7aa390516e483cc671711de5446b322bd5e8..efd96c7d9a0047b0aa79eaa2947a0f0d22640c84 100644
--- a/editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/utilities/ast/DartElementLocatorTest.java
+++ b/editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/utilities/ast/DartElementLocatorTest.java
@@ -455,6 +455,67 @@ public class DartElementLocatorTest extends TestCase {
4);
}
+ public void test_identifierInComment_ofClass_field() throws Exception {
+ testElementLocator(
+ formatLines(
+ "// filler filler filler filler filler filler filler filler filler filler filler",
+ "/** Main field is [myField]. */",
+ "class A {",
+ " var myField = 5;",
+ "}",
+ ""),
+ "myField]",
+ Field.class,
+ "myField = 5",
+ "myField".length());
+ }
+
+ public void test_identifierInComment_ofClass_method() throws Exception {
+ testElementLocator(
+ formatLines(
+ "// filler filler filler filler filler filler filler filler filler filler filler",
+ "/** Main method is [foo]. */",
+ "class A {",
+ " foo() {}",
+ "}",
+ ""),
+ "foo]",
+ Method.class,
+ "foo() {}",
+ 3);
+ }
+
+ public void test_identifierInComment_ofMethod_method() throws Exception {
+ testElementLocator(
+ formatLines(
+ "// filler filler filler filler filler filler filler filler filler filler filler",
+ "class A {",
+ " /** Call [bar] instead. */",
+ " foo() {}",
+ " bar() {}",
+ "}",
+ ""),
+ "bar]",
+ Method.class,
+ "bar() {}",
+ 3);
+ }
+
+ public void test_identifierInComment_ofMethod_parameter() throws Exception {
+ testElementLocator(
+ formatLines(
+ "// filler filler filler filler filler filler filler filler filler filler filler",
+ "class A {",
+ " /** Draws point at [x] and [y]. */",
+ " drawPoint(int x, int y) {}",
+ "}",
+ ""),
+ "x]",
+ DartVariableDeclaration.class,
+ "x, int y)",
+ "x".length());
+ }
+
public void test_LibraryUnit_onPartOf() throws Exception {
TestProject testProject = new TestProject("Test");
try {

Powered by Google App Engine
This is Rietveld 408576698