IDEA-65747 Javadoc: Don't use attribute value on javadoc tag autocompletion

1. Tag name only is used during javadoc tag auto completion;
2. Corresponding test is added;
3. java-impl module config file is corrected in order to define test source root;
This commit is contained in:
Denis Zhdanov
2011-02-21 16:10:48 +03:00
parent c0eb2f3108
commit 8ba5d2f75c
3 changed files with 12 additions and 0 deletions
+1
View File
@@ -4,6 +4,7 @@
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/testSrc" isTestSource="true" />
</content>
<orderEntry type="module" module-name="boot" />
<orderEntry type="inheritedJdk" />
@@ -117,6 +117,11 @@ public class JavadocTypedHandler extends TypedHandlerDelegate {
return null;
}
return text.subSequence(i + 1, endOffset).toString();
// There is a possible case that opening tag has attributes, e.g. <a href='bla-bla-bla'>[offset]. We want to extract
// only tag name then.
case ' ':
case '\t': endOffset = i;
}
}
return null;
@@ -37,6 +37,12 @@ public class JavadocTypedHandlerTest {
doTest("<t\nag><caret>", null);
}
@Test
public void tagWithAttribute() {
doTest("<a href='www'><caret>", "a");
//TODO den implement
}
private static void doTest(String text, String expected) {
StringBuilder normalized = new StringBuilder();
int offset = text.indexOf(CARET_MARKER);