From 61838764dd2a741a9ce4e54c62296524e7e78a62 Mon Sep 17 00:00:00 2001 From: Luo Tim Date: Tue, 8 Oct 2024 23:08:19 +0800 Subject: [PATCH] Adjust code format --- .../devchat/plugin/completion/agent/ContextBuilder.kt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/ai/devchat/plugin/completion/agent/ContextBuilder.kt b/src/main/kotlin/ai/devchat/plugin/completion/agent/ContextBuilder.kt index ce4736b..5c7e228 100644 --- a/src/main/kotlin/ai/devchat/plugin/completion/agent/ContextBuilder.kt +++ b/src/main/kotlin/ai/devchat/plugin/completion/agent/ContextBuilder.kt @@ -143,9 +143,8 @@ class ContextBuilder(val file: PsiFile, val offset: Int) { } ?.takeWhile { checkAndUpdateTokenCount(it.second) } ?.joinToString(separator = "") {(name, snippet) -> - val commentedContent = snippet.content.lines().joinToString(LINE_SEPARATOR.toString()) { - "$commentPrefix $it" - } + val commentedContent = snippet.content.lines() + .joinToString(LINE_SEPARATOR.toString()) { "$commentPrefix $it" } "$commentPrefix Symbol type definition:\n\n" + "$commentPrefix ${name}\n\n" + "$commentPrefix ${snippet.filepath}\n\n" + @@ -163,9 +162,8 @@ class ContextBuilder(val file: PsiFile, val offset: Int) { .filter { it.content.lines().count(String::isBlank) <= 50 } .takeWhile(::checkAndUpdateTokenCount) .joinToString(separator = "") {snippet -> - val commentedContent = snippet.content.lines().joinToString(LINE_SEPARATOR.toString()) { - "$commentPrefix $it" - } + val commentedContent = snippet.content.lines() + .joinToString(LINE_SEPARATOR.toString()) { "$commentPrefix $it" } "$commentPrefix Recently open file:\n\n" + "$commentPrefix ${snippet.filepath}\n\n" + "$commentedContent\n\n\n\n"