Skip to content

Commit bda2eb3

Browse files
committed
Merge tag '0.34.2' into develop
# Conflicts: # Tool/Sources/ChatTab/ChatTab.swift # Version.xcconfig
2 parents 3d8e66e + 1fe0874 commit bda2eb3

7 files changed

Lines changed: 33 additions & 23 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

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,13 @@ Open the app, the app will create a launch agent to setup a background running S
9090

9191
Enable the extension in `System Settings.app`.
9292

93+
#### macOS 15
94+
From the Apple menu located in the top-left corner of your screen click `System Settings`. Navigate to `General` then `Login Items & Extensions`. Click `Xcode Source Editor` and tick `Copilot for Xcode`.
95+
96+
#### MacOS 14
9397
From the Apple menu located in the top-left corner of your screen click `System Settings`. Navigate to `Privacy & Security` then toward the bottom click `Extensions`. Click `Xcode Source Editor` and tick `Copilot`.
9498

99+
#### Older Versions
95100
If you are using macOS Monterey, enter the `Extensions` menu in `System Preferences.app` with its dedicated icon.
96101

97102
### Granting Permissions to the App

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/LanguageServer/CodeiumModels.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@ struct CompletionPart: Codable {
7272
}
7373

7474
struct CodeiumDocument: Codable {
75-
var absolute_path: String
76-
// Path relative to the root of the workspace.
77-
var relative_path: String
75+
var absolute_path_migrate_me_to_uri: String
7876
var text: String
7977
// Language ID provided by the editor.
8078
var editor_language: String

Tool/Sources/CodeiumService/Services/CodeiumService.swift

Lines changed: 4 additions & 9 deletions
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
}
@@ -257,14 +257,12 @@ extension CodeiumService: CodeiumSuggestionServiceType {
257257

258258
requestCounter += 1
259259
let languageId = languageIdentifierFromFileURL(fileURL)
260-
let relativePath = getRelativePath(of: fileURL)
261260

262261
let task = Task {
263262
let request = try await CodeiumRequest.GetCompletion(requestBody: .init(
264263
metadata: getMetadata(),
265264
document: .init(
266-
absolute_path: fileURL.path,
267-
relative_path: relativePath,
265+
absolute_path_migrate_me_to_uri: fileURL.path,
268266
text: content,
269267
editor_language: languageId.rawValue,
270268
language: .init(codeLanguage: languageId),
@@ -278,8 +276,7 @@ extension CodeiumService: CodeiumSuggestionServiceType {
278276
.map { openedDocument in
279277
let languageId = languageIdentifierFromFileURL(openedDocument.url)
280278
return .init(
281-
absolute_path: openedDocument.url.path,
282-
relative_path: openedDocument.relativePath,
279+
absolute_path_migrate_me_to_uri: openedDocument.url.path,
283280
text: openedDocument.content,
284281
editor_language: languageId.rawValue,
285282
language: .init(codeLanguage: languageId)
@@ -417,11 +414,9 @@ extension CodeiumService: CodeiumSuggestionServiceType {
417414
workspaceURL: URL
418415
) async throws {
419416
let languageId = languageIdentifierFromFileURL(fileURL)
420-
let relativePath = getRelativePath(of: fileURL)
421417
let request = await CodeiumRequest.RefreshContextForIdeAction(requestBody: .init(
422418
active_document: .init(
423-
absolute_path: fileURL.path,
424-
relative_path: relativePath,
419+
absolute_path_migrate_me_to_uri: fileURL.path,
425420
text: content,
426421
editor_language: languageId.rawValue,
427422
language: .init(codeLanguage: languageId),

Tool/Sources/SuggestionProvider/SuggestionServiceMiddleware.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ public enum SuggestionServiceMiddlewareContainer {
4545

4646
public struct DisabledLanguageSuggestionServiceMiddleware: SuggestionServiceMiddleware {
4747
public init() {}
48+
49+
struct DisabledLanguageError: Error, LocalizedError {
50+
let language: String
51+
var errorDescription: String? {
52+
"Suggestion service is disabled for \(language)."
53+
}
54+
}
4855

4956
public func getSuggestion(
5057
_ request: SuggestionRequest,
@@ -55,10 +62,7 @@ public struct DisabledLanguageSuggestionServiceMiddleware: SuggestionServiceMidd
5562
if UserDefaults.shared.value(for: \.suggestionFeatureDisabledLanguageList)
5663
.contains(where: { $0 == language.rawValue })
5764
{
58-
#if DEBUG
59-
Logger.service.info("Suggestion service is disabled for \(language).")
60-
#endif
61-
return []
65+
throw DisabledLanguageError(language: language.rawValue)
6266
}
6367

6468
return try await next(request)

Version.xcconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
APP_VERSION = 0.34.2
2-
APP_BUILD = 414
2+
APP_BUILD = 415
33

0 commit comments

Comments
 (0)