Skip to content

Commit 1089530

Browse files
committed
Bump supported Codeium version
1 parent 0f70ffc commit 1089530

3 files changed

Lines changed: 15 additions & 7 deletions

File tree

Core/Sources/HostApp/AccountSettings/CodeiumView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ struct CodeiumView: View {
151151
Text("Language Server Version: \(version)")
152152
uninstallButton
153153
}
154-
case let .outdated(current: current, latest: latest):
154+
case let .outdated(current: current, latest: latest, _):
155155
HStack {
156156
Text("Language Server Version: \(current) (Update Available: \(latest))")
157157
uninstallButton
@@ -323,7 +323,7 @@ struct CodeiumView_Previews: PreviewProvider {
323323

324324
CodeiumView(viewModel: TestViewModel(
325325
isSignedIn: true,
326-
installationStatus: .outdated(current: "1.2.9", latest: "1.3.0"),
326+
installationStatus: .outdated(current: "1.2.9", latest: "1.3.0", mandatory: true),
327327
installationStep: .downloading
328328
))
329329

Tool/Sources/CodeiumService/LanguageServer/CodeiumInstallationManager.swift

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import Terminal
33

44
public struct CodeiumInstallationManager {
55
private static var isInstalling = false
6-
static let latestSupportedVersion = "1.8.83"
6+
static let latestSupportedVersion = "1.20.9"
7+
static let minimumSupportedVersion = "1.20.0"
78

89
public init() {}
910

@@ -60,7 +61,7 @@ public struct CodeiumInstallationManager {
6061
public enum InstallationStatus {
6162
case notInstalled
6263
case installed(String)
63-
case outdated(current: String, latest: String)
64+
case outdated(current: String, latest: String, mandatory: Bool)
6465
case unsupported(current: String, latest: String)
6566
}
6667

@@ -87,14 +88,21 @@ public struct CodeiumInstallationManager {
8788
{
8889
switch version.compare(targetVersion, options: .numeric) {
8990
case .orderedAscending:
90-
return .outdated(current: version, latest: targetVersion)
91+
switch version.compare(Self.minimumSupportedVersion) {
92+
case .orderedAscending:
93+
return .outdated(current: version, latest: Self.latestSupportedVersion, mandatory: true)
94+
case .orderedSame:
95+
return .outdated(current: version, latest: Self.latestSupportedVersion, mandatory: false)
96+
case .orderedDescending:
97+
return .outdated(current: version, latest: Self.latestSupportedVersion, mandatory: false)
98+
}
9199
case .orderedSame:
92100
return .installed(version)
93101
case .orderedDescending:
94102
return .unsupported(current: version, latest: targetVersion)
95103
}
96104
}
97-
return .outdated(current: "Unknown", latest: Self.latestSupportedVersion)
105+
return .outdated(current: "Unknown", latest: Self.latestSupportedVersion, mandatory: false)
98106
}
99107

100108
public enum InstallationStep {

Tool/Sources/CodeiumService/Services/CodeiumService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public class CodeiumService {
102102
languageServerVersion = version
103103
case .notInstalled:
104104
throw CodeiumError.languageServerNotInstalled
105-
case let .outdated(version, _):
105+
case let .outdated(version, _, _):
106106
languageServerVersion = version
107107
throw CodeiumError.languageServerOutdated
108108
}

0 commit comments

Comments
 (0)