Skip to content

Commit

Permalink
Filter out private members from completion
Browse files Browse the repository at this point in the history
  • Loading branch information
fkorotkov committed May 22, 2021
1 parent 27bd7ea commit 03ff5d8
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package org.cirruslabs.intellij.starlark.modules

import com.intellij.openapi.util.TextRange
import com.intellij.psi.PsiElement
import com.intellij.psi.PsiNamedElement
import com.intellij.psi.PsiReference
import com.jetbrains.python.psi.PyStringLiteralExpression

Expand Down Expand Up @@ -30,7 +31,7 @@ class LoadedElementReference(

override fun getVariants(): Array<Any> {
val moduleFile = CirrusModuleManager.resolveModuleFile(element.containingFile, module) ?: return emptyArray()
return (moduleFile.topLevelAttributes.toList<PsiElement>() + moduleFile.topLevelFunctions.toList<PsiElement>())
.toTypedArray()
return (moduleFile.topLevelAttributes.toList<PsiNamedElement>() + moduleFile.topLevelFunctions.toList<PsiNamedElement>())
.filter { it.name?.startsWith('_') == false }.toTypedArray()
}
}

0 comments on commit 03ff5d8

Please sign in to comment.