Skip to content

Commit

Permalink
Reformat code with spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
pkukielka committed Jul 18, 2024
1 parent 986cc76 commit 2a92540
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.sourcegraph.cody.agent

import com.sourcegraph.cody.agent.protocol.ChatError
import com.sourcegraph.cody.agent.protocol.ChatMessage
import com.sourcegraph.cody.agent.protocol.ChatModelsResponse
import com.sourcegraph.cody.agent.protocol.ContextItem
import com.sourcegraph.cody.agent.protocol.Repo

Expand Down Expand Up @@ -54,10 +53,7 @@ data class ExtensionMessage(

data class WebviewPostMessageParams(val id: String, val message: ExtensionMessage)

data class ConfigFeatures(
val attribution: Boolean,
val serverSentModels: Boolean
)
data class ConfigFeatures(val attribution: Boolean, val serverSentModels: Boolean)

data class EnhancedContextContextT(val groups: List<ContextGroup>)

Expand Down
6 changes: 3 additions & 3 deletions src/main/kotlin/com/sourcegraph/cody/chat/ui/LlmDropdown.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class LlmDropdown(
val parentDialog: EditCommandPrompt?,
val chatModelProviderFromState: ChatModelsResponse.ChatModelProvider?,
) : ComboBox<ChatModelsResponse.ChatModelProvider>(MutableCollectionComboBoxModel()) {
var hasServerSentModels = false
var hasServerSentModels = false

init {
renderer = LlmComboBoxRenderer(this)
Expand All @@ -50,7 +50,7 @@ class LlmDropdown(

private fun subscribeToFeatureUpdates() {
val currentConfigFeatures: CurrentConfigFeatures =
project.getService(CurrentConfigFeatures::class.java)
project.getService(CurrentConfigFeatures::class.java)
currentConfigFeatures.attach(::handleConfigUpdate)
}

Expand All @@ -64,7 +64,7 @@ class LlmDropdown(

@RequiresEdt
private fun updateModelsInUI(models: List<ChatModelsResponse.ChatModelProvider>) {
if (project.isDisposed) return
if (project.isDisposed) return
this.removeAllItems()

val availableModels = models.filterNot { it.isDeprecated() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class CurrentConfigFeaturesTest {
fun `observer is notified`() {
val current = CurrentConfigFeatures()
val observer = FakeObserver()
val expected = ConfigFeatures(attribution = true, serverSentModels =true)
val expected = ConfigFeatures(attribution = true, serverSentModels = true)
current.attach(observer)
current.update(expected)
assertThat(observer.features, hasItems(expected))
Expand Down

0 comments on commit 2a92540

Please sign in to comment.