mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
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:
@@ -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;
|
||||
|
||||
+6
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user