Skip to content

Commit a5abcf3

Browse files
committed
Only provide index completions on name references and type elements
This means that index completions will only show up where they actually make sense.
1 parent 8306dd7 commit a5abcf3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/src/main/kotlin/org/javacs/kt/completion/Completions.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ data class ElementCompletionItems(val items: Sequence<CompletionItem>, val isExh
158158

159159
/** Finds completions based on the element around the user's cursor. */
160160
private fun elementCompletionItems(file: CompiledFile, cursor: Int, config: CompletionConfiguration, partial: String): ElementCompletionItems {
161-
val surroundingElement = completableElement(file, cursor) ?: return ElementCompletionItems(emptySequence(), isExhaustive = false)
161+
val surroundingElement = completableElement(file, cursor) ?: return ElementCompletionItems(emptySequence(), isExhaustive = true)
162162
val isExhaustive = surroundingElement !is KtNameReferenceExpression && surroundingElement !is KtTypeElement
163163
val completions = elementCompletions(file, cursor, surroundingElement)
164164

0 commit comments

Comments
 (0)