File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
src/main/kotlin/org/tabooproject/development/completion Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import com.intellij.codeInsight.lookup.LookupElementBuilder
8
8
import com.intellij.psi.PsiDocumentManager
9
9
import com.intellij.psi.util.PsiTreeUtil
10
10
import com.intellij.util.PlatformIcons
11
+ import org.jetbrains.kotlin.psi.KtDotQualifiedExpression
11
12
import org.jetbrains.kotlin.psi.KtFile
12
13
import org.jetbrains.kotlin.psi.KtImportDirective
13
14
import org.jetbrains.kotlin.psi.KtPsiFactory
@@ -17,6 +18,10 @@ import org.jetbrains.kotlin.resolve.ImportPath
17
18
class InfoFuncCompletion : CompletionContributor () {
18
19
19
20
override fun fillCompletionVariants (parameters : CompletionParameters , result : CompletionResultSet ) {
21
+ val position = parameters.position
22
+ val parent = position.parent
23
+ // 确保前面是个对象, 否则不提供打印
24
+ (parent.parent as ? KtDotQualifiedExpression )?.receiverExpression ? : return
20
25
result.addElement(
21
26
PrioritizedLookupElement .withPriority(
22
27
LookupElementBuilder .create(" info" )
You can’t perform that action at this time.
0 commit comments