mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
restore autopopup after typing # in javadoc (IDEA-135231)
This commit is contained in:
+10
-5
@@ -33,11 +33,16 @@ public class JavadocCompletionConfidence extends CompletionConfidence {
|
||||
@NotNull
|
||||
@Override
|
||||
public ThreeState shouldSkipAutopopup(@NotNull PsiElement contextElement, @NotNull PsiFile psiFile, int offset) {
|
||||
if (psiElement().inside(PsiDocTag.class).accepts(contextElement) && findJavaReference(psiFile, offset - 1) != null) {
|
||||
return ThreeState.NO;
|
||||
}
|
||||
if (PlatformPatterns.psiElement(JavaDocTokenType.DOC_TAG_NAME).accepts(contextElement)) {
|
||||
return ThreeState.NO;
|
||||
if (psiElement().inside(PsiDocTag.class).accepts(contextElement)) {
|
||||
if (findJavaReference(psiFile, offset - 1) != null) {
|
||||
return ThreeState.NO;
|
||||
}
|
||||
if (PlatformPatterns.psiElement(JavaDocTokenType.DOC_TAG_NAME).accepts(contextElement)) {
|
||||
return ThreeState.NO;
|
||||
}
|
||||
if (contextElement.textMatches("#")) {
|
||||
return ThreeState.NO;
|
||||
}
|
||||
}
|
||||
return super.shouldSkipAutopopup(contextElement, psiFile, offset);
|
||||
}
|
||||
|
||||
@@ -256,6 +256,17 @@ class JavaAutoPopupTest extends CompletionAutoPopupTestCase {
|
||||
assert lookup
|
||||
}
|
||||
|
||||
public void "test popup after hash in javadoc"() {
|
||||
myFixture.configureByText("a.java", """
|
||||
/**
|
||||
* {@link String<caret>}
|
||||
*/
|
||||
class Foo {}
|
||||
""")
|
||||
type '#'
|
||||
assert lookup
|
||||
}
|
||||
|
||||
public void "test popup in javadoc local reference"() {
|
||||
myFixture.configureByText("a.java", """
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user