Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Bump supported Codeium version
  • Loading branch information
intitni committed Oct 6, 2024
commit 10895301994c126d6b94fdf537db130b73764215
4 changes: 2 additions & 2 deletions Core/Sources/HostApp/AccountSettings/CodeiumView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ struct CodeiumView: View {
Text("Language Server Version: \(version)")
uninstallButton
}
case let .outdated(current: current, latest: latest):
case let .outdated(current: current, latest: latest, _):
HStack {
Text("Language Server Version: \(current) (Update Available: \(latest))")
uninstallButton
Expand Down Expand Up @@ -323,7 +323,7 @@ struct CodeiumView_Previews: PreviewProvider {

CodeiumView(viewModel: TestViewModel(
isSignedIn: true,
installationStatus: .outdated(current: "1.2.9", latest: "1.3.0"),
installationStatus: .outdated(current: "1.2.9", latest: "1.3.0", mandatory: true),
installationStep: .downloading
))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import Terminal

public struct CodeiumInstallationManager {
private static var isInstalling = false
static let latestSupportedVersion = "1.8.83"
static let latestSupportedVersion = "1.20.9"
static let minimumSupportedVersion = "1.20.0"

public init() {}

Expand Down Expand Up @@ -60,7 +61,7 @@ public struct CodeiumInstallationManager {
public enum InstallationStatus {
case notInstalled
case installed(String)
case outdated(current: String, latest: String)
case outdated(current: String, latest: String, mandatory: Bool)
case unsupported(current: String, latest: String)
}

Expand All @@ -87,14 +88,21 @@ public struct CodeiumInstallationManager {
{
switch version.compare(targetVersion, options: .numeric) {
case .orderedAscending:
return .outdated(current: version, latest: targetVersion)
switch version.compare(Self.minimumSupportedVersion) {
case .orderedAscending:
return .outdated(current: version, latest: Self.latestSupportedVersion, mandatory: true)
case .orderedSame:
return .outdated(current: version, latest: Self.latestSupportedVersion, mandatory: false)
case .orderedDescending:
return .outdated(current: version, latest: Self.latestSupportedVersion, mandatory: false)
}
case .orderedSame:
return .installed(version)
case .orderedDescending:
return .unsupported(current: version, latest: targetVersion)
}
}
return .outdated(current: "Unknown", latest: Self.latestSupportedVersion)
return .outdated(current: "Unknown", latest: Self.latestSupportedVersion, mandatory: false)
}

public enum InstallationStep {
Expand Down
2 changes: 1 addition & 1 deletion Tool/Sources/CodeiumService/Services/CodeiumService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public class CodeiumService {
languageServerVersion = version
case .notInstalled:
throw CodeiumError.languageServerNotInstalled
case let .outdated(version, _):
case let .outdated(version, _, _):
languageServerVersion = version
throw CodeiumError.languageServerOutdated
}
Expand Down