don't complete KDoc tag names if we have a non-empty prefix which is not a tag name
#KT-7476 Fixed
This commit is contained in:
+3
@@ -104,6 +104,9 @@ object KDocTagCompletionProvider: CompletionProvider<CompletionParameters>() {
|
||||
StandardPatterns.character().javaIdentifierPart() or singleCharPattern('@'),
|
||||
StandardPatterns.character().javaIdentifierStart() or singleCharPattern('@'))
|
||||
|
||||
if (prefix.length() > 0 && !prefix.startsWith('@')) {
|
||||
return
|
||||
}
|
||||
val resultWithPrefix = result.withPrefixMatcher(prefix)
|
||||
KDocKnownTag.values().forEach {
|
||||
resultWithPrefix.addElement(LookupElementBuilder.create("@" + it.name().toLowerCase()))
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* p<caret>
|
||||
*/
|
||||
fun f(x: Int): Int {
|
||||
}
|
||||
|
||||
// ABSENT: @param
|
||||
+6
@@ -41,6 +41,12 @@ public class KDocCompletionTestGenerated extends AbstractJvmBasicCompletionTest
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("NotTagName.kt")
|
||||
public void testNotTagName() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/kdoc/NotTagName.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ParamTag.kt")
|
||||
public void testParamTag() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/kdoc/ParamTag.kt");
|
||||
|
||||
Reference in New Issue
Block a user