Skip to content

Commit 786aac4

Browse files
committed
Make completion call pattern robust against trailing placeholder
1 parent 94b6285 commit 786aac4

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
@@ -79,7 +79,7 @@ private fun elementCompletionItems(file: CompiledFile, cursor: Int, config: Comp
7979
return visible.map { completionItem(it, surroundingElement, file, config) }
8080
}
8181

82-
private val callPattern = Regex("(.*)\\((\\$\\d+)?\\)")
82+
private val callPattern = Regex("(.*)\\((?:\\$\\d+)?\\)(?:\\$0)?")
8383
private val methodSignature = Regex("""(?:fun|constructor) (?:<(?:[a-zA-Z\?\!\: ]+)(?:, [A-Z])*> )?([a-zA-Z]+\(.*\))""")
8484

8585
private fun completionItem(d: DeclarationDescriptor, surroundingElement: KtElement, file: CompiledFile, config: CompletionConfiguration): CompletionItem {

0 commit comments

Comments
 (0)