Skip to content

Commit f9d4913

Browse files
committed
Minor changes to make it build
1 parent c5f8f10 commit f9d4913

File tree

8 files changed

+40
-84
lines changed

8 files changed

+40
-84
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "Pro"]
2-
path = Pro
3-
url = git@github.com:intitni/CopilotForXcodePro.git

Copilot for Xcode.xcodeproj/project.pbxproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@
205205
C8216B772980370100AD38C7 /* ReloadLaunchAgent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReloadLaunchAgent.swift; sourceTree = "<group>"; };
206206
C828B27D2B1F241500E7612A /* ExtensionPoint.appextensionpoint */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = ExtensionPoint.appextensionpoint; sourceTree = "<group>"; };
207207
C82E38492A1F025F00D4EADF /* LICENSE */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
208-
C83E5DED2A38CD8C0071506D /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
209208
C8520300293C4D9000460097 /* Helpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Helpers.swift; sourceTree = "<group>"; };
210209
C8520308293D805800460097 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
211210
C861A6A229E5503F005C41A3 /* PromptToCodeCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PromptToCodeCommand.swift; sourceTree = "<group>"; };
@@ -335,7 +334,6 @@
335334
C887BC832965D96000931567 /* DEVELOPMENT.md */,
336335
C8520308293D805800460097 /* README.md */,
337336
C82E38492A1F025F00D4EADF /* LICENSE */,
338-
C83E5DED2A38CD8C0071506D /* Makefile */,
339337
C8F103292A7A365000D28F4F /* launchAgent.plist */,
340338
C8738B6D2BE4F3E800609E7F /* bridgeLaunchAgent.plist */,
341339
C81E867D296FE4420026E908 /* Version.xcconfig */,

Core/Package.swift

Lines changed: 37 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -4,57 +4,6 @@
44
import Foundation
55
import PackageDescription
66

7-
// MARK: - Pro
8-
9-
extension [Target.Dependency] {
10-
func pro(_ targetNames: [String]) -> [Target.Dependency] {
11-
if isProIncluded {
12-
// include the pro package
13-
return self + targetNames.map { Target.Dependency.product(name: $0, package: "Pro") }
14-
}
15-
return self
16-
}
17-
}
18-
19-
extension [Package.Dependency] {
20-
var pro: [Package.Dependency] {
21-
if isProIncluded {
22-
// include the pro package
23-
return self + [.package(path: "../Pro/Pro")]
24-
}
25-
return self
26-
}
27-
}
28-
29-
let isProIncluded: Bool = {
30-
func isProIncluded(file: StaticString = #file) -> Bool {
31-
let filePath = "\(file)"
32-
let fileURL = URL(fileURLWithPath: filePath)
33-
let rootURL = fileURL
34-
.deletingLastPathComponent()
35-
.deletingLastPathComponent()
36-
let confURL = rootURL.appendingPathComponent("PLUS")
37-
if !FileManager.default.fileExists(atPath: confURL.path) {
38-
return false
39-
}
40-
do {
41-
if let content = try String(
42-
data: Data(contentsOf: confURL),
43-
encoding: .utf8
44-
) {
45-
if content.hasPrefix("YES") {
46-
return true
47-
}
48-
}
49-
return false
50-
} catch {
51-
return false
52-
}
53-
}
54-
55-
return isProIncluded()
56-
}()
57-
587
// MARK: - Package
598

609
let package = Package(
@@ -414,3 +363,40 @@ let package = Package(
414363
]
415364
)
416365

366+
extension [Target.Dependency] {
367+
func pro(_ targetNames: [String]) -> [Target.Dependency] {
368+
if isProIncluded {
369+
// include the pro package
370+
return self + targetNames.map { Target.Dependency.product(name: $0, package: "Pro") }
371+
}
372+
return self
373+
}
374+
}
375+
376+
extension [Package.Dependency] {
377+
var pro: [Package.Dependency] {
378+
if isProIncluded {
379+
// include the pro package
380+
return self + [.package(path: "../../CopilotForXcodePro/Pro")]
381+
}
382+
return self
383+
}
384+
}
385+
386+
let isProIncluded: Bool = {
387+
func isProIncluded(file: StaticString = #file) -> Bool {
388+
let filePath = "\(file)"
389+
let fileURL = URL(fileURLWithPath: filePath)
390+
let rootURL = fileURL
391+
.deletingLastPathComponent()
392+
.deletingLastPathComponent()
393+
.deletingLastPathComponent()
394+
let confURL = rootURL.appendingPathComponent("PLUS")
395+
if !FileManager.default.fileExists(atPath: confURL.path) {
396+
return false
397+
}
398+
return true
399+
}
400+
401+
return isProIncluded()
402+
}()

Core/Sources/ChatGPTChatTab/Chat.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import ChatBasic
12
import ChatService
23
import ComposableArchitecture
34
import Foundation
@@ -48,7 +49,7 @@ public struct DisplayedChatMessage: Equatable {
4849
self.id = id
4950
self.role = role
5051
self.text = text
51-
self.markdownContent = .init(text)
52+
markdownContent = .init(text)
5253
self.references = references
5354
}
5455
}

Makefile

Lines changed: 0 additions & 25 deletions
This file was deleted.

Pro

Lines changed: 0 additions & 1 deletion
This file was deleted.

Tool/Sources/CodeiumService/ChatTab/CodeiumChatTab.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import AppKit
22
import ChatTab
33
import Combine
44
import ComposableArchitecture
5-
import LicenseManagement
65
import Logger
76
import Preferences
87
import SwiftUI

Tool/Sources/OpenAIService/Memory/ChatGPTMemory.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import ChatBasic
12
import Foundation
23

34
public struct ChatGPTPrompt: Equatable {

0 commit comments

Comments
 (0)