Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
196cdcf
Merge tag '0.23.2' into develop
intitni Sep 9, 2023
dea46ab
Add Copilot for Xcode Plus.xcworkspace
intitni Sep 9, 2023
7288b61
Add workspace.didUpdateFilespace
intitni Sep 9, 2023
16c76b4
Update
intitni Sep 10, 2023
a4439e6
Change type of Filespace.language
intitni Sep 11, 2023
cede9e0
Add EnhancedWorkspacePlugin
intitni Sep 11, 2023
85872fa
Move ChatContextCollector to Tool
intitni Sep 14, 2023
2a686d3
Track workspaceURL
intitni Sep 17, 2023
37ea5c0
Add ProChatContextCollectors
intitni Sep 17, 2023
8c2f2b8
Remove useless schemes
intitni Sep 17, 2023
e187a35
Add function calling agent
intitni Sep 17, 2023
477c6fc
Update function call base agent
intitni Sep 17, 2023
eb71146
Fix latestActiveXcode initialization
intitni Sep 17, 2023
a08cca8
Support no memory for OpenAIChat
intitni Sep 17, 2023
57925ce
Update
intitni Sep 17, 2023
59e9a04
Make AgentScratchPad generic
intitni Sep 18, 2023
5e8596c
Rename cases of ReturnValue
intitni Sep 18, 2023
e2c469f
Adjust agent
intitni Sep 18, 2023
c1f1250
Update prompt
intitni Sep 18, 2023
67c200e
Update
intitni Sep 18, 2023
ff01a98
Add ReActFunctionCallingChatAgent
intitni Sep 18, 2023
144e4e6
ReActFunctionCallingChatAgent
intitni Sep 18, 2023
87f876a
Add StructuredOutputChatModelChain
intitni Sep 19, 2023
314841b
Update
intitni Sep 19, 2023
cfd11d8
Update
intitni Sep 19, 2023
48acf04
Adjust API of ChatGPTFunction
intitni Sep 20, 2023
d4c811c
Add realtimeActiveProjectURL
intitni Sep 20, 2023
8334ce8
Make active project/workspace/document URL optional
intitni Sep 20, 2023
40fe5d4
Update AgentExecutor
intitni Sep 21, 2023
b30d42b
Update
intitni Sep 21, 2023
bf94948
Update QAInformationRetrievalChain to support multiple vector store
intitni Sep 21, 2023
14c8d07
Add dimensions to embedding model
intitni Sep 21, 2023
c74a50b
Update
intitni Sep 21, 2023
01fed71
Add comment
intitni Sep 21, 2023
b0605ba
Make the keys publick
intitni Sep 21, 2023
4860fc8
Add a method to access typed metadata keys
intitni Sep 21, 2023
ba3b360
Simplify usage of StructuredOutputChatModelChain
intitni Sep 21, 2023
74df8f7
Adjust implementation of QAInformationRetrievalChain
intitni Sep 21, 2023
de74bfb
Fix FunctionCallingAgentTool
intitni Sep 21, 2023
a0230b4
Update
intitni Sep 21, 2023
12cd285
WIP
intitni Sep 22, 2023
4a702ab
Update
intitni Sep 24, 2023
3967eb4
Update
intitni Sep 26, 2023
dffdf5f
Update pro package
intitni Sep 26, 2023
ef1e9c9
Merge branch 'feature/project-scope-v1' into develop
intitni Sep 26, 2023
268c818
Add settings keys for prompt to code chat model and embedding model
intitni Sep 26, 2023
d16f291
Add pickers for prompt to code chat/embedding model
intitni Sep 26, 2023
74cc12d
Update PromtToCodeService to use the defined models
intitni Sep 26, 2023
d38a481
Add description to the function calling toggle
intitni Sep 26, 2023
202450c
Merge branch 'feature/custom-prompt-to-code-model' into develop
intitni Sep 26, 2023
46bf8aa
Fix a racing issue
intitni Sep 26, 2023
9ee64dc
Update pro package
intitni Sep 27, 2023
cc0d5d3
Remove generic of OverridingEmbeddingConfiguration
intitni Sep 27, 2023
30b556d
Support changing temperature and model from chat tab
intitni Sep 27, 2023
7fedca9
Merge branch 'feature/change-chat-model-and-temparature' into develop
intitni Sep 27, 2023
ce539f9
Fix unit tests
intitni Sep 27, 2023
363e2f8
Update pro package
intitni Sep 27, 2023
f43065e
Bump GitHub Copilot to 1.10.3
intitni Sep 27, 2023
91ff0eb
Bump Codeium to 1.2.93
intitni Sep 27, 2023
46d91fb
Bump version to 0.24.0
intitni Sep 27, 2023
edc8c29
Check if to include pro package with a configuration file
intitni Sep 27, 2023
d171043
Prevent opening multiple prompt to code panel
intitni Sep 27, 2023
9b6f798
Fix project url detection when it's a git worktree, workspace, xcproj…
intitni Sep 27, 2023
07cf6e8
Adjust prompt
intitni Sep 27, 2023
b291d99
Update chat instruction
intitni Sep 27, 2023
20bf45d
Update
intitni Sep 27, 2023
5aedc75
Fix that activateOrCreatePromptToCode is not making the panel active
intitni Sep 27, 2023
17d202a
Add toggle to disable enhanced workspace
intitni Sep 27, 2023
4fed754
Fix project URL
intitni Sep 27, 2023
4affcf0
Update appcast.xml
intitni Sep 28, 2023
dfd69e8
Update
intitni Sep 28, 2023
151776f
Merge branch 'release/0.24.0'
intitni Sep 28, 2023
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
Make active project/workspace/document URL optional
  • Loading branch information
intitni committed Sep 20, 2023
commit 8334ce8d820ed7bd3778d852a044aa558bd1ad20
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct CustomCommandTemplateProcessor {
func getEditorInformation() -> EditorInformation {
let editorContent = XcodeInspector.shared.focusedEditor?.content
let documentURL = XcodeInspector.shared.activeDocumentURL
let language = languageIdentifierFromFileURL(documentURL)
let language = documentURL.map(languageIdentifierFromFileURL) ?? .plaintext

return .init(
editorContent: editorContent,
Expand Down
9 changes: 4 additions & 5 deletions Core/Sources/Service/GUI/ChatTabFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,10 @@ enum ChatTabFactory {
let content = editor.content
return .init(
selectedText: content.selectedContent,
language: languageIdentifierFromFileURL(
XcodeInspector.shared
.activeDocumentURL
)
.rawValue,
language: (
XcodeInspector.shared.activeDocumentURL
.map(languageIdentifierFromFileURL) ?? .plaintext
).rawValue,
fileContent: content.content
)
},
Expand Down
5 changes: 3 additions & 2 deletions Core/Sources/Service/RealtimeSuggestionController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ public actor RealtimeSuggestionController {
await self.triggerPrefetchDebounced()
await self.notifyEditingFileChange(editor: focusElement)
case kAXSelectedTextChangedNotification:
guard let sourceEditor = await sourceEditor else { continue }
let fileURL = XcodeInspector.shared.activeDocumentURL
guard let sourceEditor = await sourceEditor,
let fileURL = XcodeInspector.shared.activeDocumentURL
else { continue }
await PseudoCommandHandler().invalidateRealtimeSuggestionsIfNeeded(
fileURL: fileURL,
sourceEditor: sourceEditor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ public struct PanelFeature: ReducerProtocol {
switch action {
case .presentSuggestion:
return .run { send in
guard let provider = await fetchSuggestionProvider(
fileURL: xcodeInspector.activeDocumentURL
) else { return }
guard let fileURL = xcodeInspector.activeDocumentURL,
let provider = await fetchSuggestionProvider(fileURL: fileURL)
else { return }
await send(.presentSuggestionProvider(provider, displayContent: true))
}

Expand Down Expand Up @@ -96,7 +96,7 @@ public struct PanelFeature: ReducerProtocol {
case .switchToAnotherEditorAndUpdateContent:
state.content.error = nil
return .run { send in
let fileURL = xcodeInspector.activeDocumentURL
guard let fileURL = xcodeInspector.realtimeActiveDocumentURL else { return }
if let suggestion = await fetchSuggestionProvider(fileURL: fileURL) {
await send(.presentSuggestionProvider(suggestion, displayContent: false))
}
Expand Down
9 changes: 5 additions & 4 deletions Core/Sources/SuggestionWidget/WidgetView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct WidgetView: View {
@State var isHovering: Bool = false
var onOpenChatClicked: () -> Void = {}
var onCustomCommandClicked: (CustomCommand) -> Void = { _ in }

@AppStorage(\.hideCircularWidget) var hideCircularWidget

var body: some View {
Expand Down Expand Up @@ -216,8 +216,9 @@ extension WidgetContextMenu {
@ViewBuilder
var enableSuggestionForProject: some View {
WithViewStore(store) { _ in
let projectPath = xcodeInspector.activeProjectRootURL.path
if disableSuggestionFeatureGlobally {
if let projectPath = xcodeInspector.activeProjectRootURL?.path,
disableSuggestionFeatureGlobally
{
let matchedPath = suggestionFeatureEnabledProjectList.first { path in
projectPath.hasPrefix(path)
}
Expand All @@ -243,7 +244,7 @@ extension WidgetContextMenu {
var disableSuggestionForLanguage: some View {
WithViewStore(store) { _ in
let fileURL = xcodeInspector.activeDocumentURL
let fileLanguage = languageIdentifierFromFileURL(fileURL)
let fileLanguage = fileURL.map(languageIdentifierFromFileURL) ?? .plaintext
let matched = suggestionFeatureDisabledLanguageList.first { rawValue in
fileLanguage.rawValue == rawValue
}
Expand Down
18 changes: 12 additions & 6 deletions ExtensionService/AppDelegate+Menu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,12 @@ extension AppDelegate: NSMenuDelegate {
case xcodeInspectorDebugMenuIdentifier:
let inspector = XcodeInspector.shared
menu.items.removeAll()
menu.items.append(.text("Active Project: \(inspector.activeProjectRootURL)"))
menu.items.append(.text("Active Workspace: \(inspector.activeWorkspaceURL)"))
menu.items.append(.text("Active Document: \(inspector.activeDocumentURL)"))
menu.items
.append(.text("Active Project: \(inspector.activeProjectRootURL?.path ?? "N/A")"))
menu.items
.append(.text("Active Workspace: \(inspector.activeWorkspaceURL?.path ?? "N/A")"))
menu.items
.append(.text("Active Document: \(inspector.activeDocumentURL?.path ?? "N/A")"))
for xcode in inspector.xcodes {
let item = NSMenuItem(
title: "Xcode \(xcode.runningApplication.processIdentifier)",
Expand All @@ -108,9 +111,12 @@ extension AppDelegate: NSMenuDelegate {
let xcodeMenu = NSMenu()
item.submenu = xcodeMenu
xcodeMenu.items.append(.text("Is Active: \(xcode.isActive)"))
xcodeMenu.items.append(.text("Active Project: \(xcode.projectRootURL)"))
xcodeMenu.items.append(.text("Active Workspace: \(xcode.workspaceURL)"))
xcodeMenu.items.append(.text("Active Document: \(xcode.documentURL)"))
xcodeMenu.items
.append(.text("Active Project: \(xcode.projectRootURL?.path ?? "N/A")"))
xcodeMenu.items
.append(.text("Active Workspace: \(xcode.workspaceURL?.path ?? "N/A")"))
xcodeMenu.items
.append(.text("Active Document: \(xcode.documentURL?.path ?? "N/A")"))

for (key, workspace) in xcode.realtimeWorkspaces {
let workspaceItem = NSMenuItem(
Expand Down
2 changes: 1 addition & 1 deletion Pro
Submodule Pro updated from 0034a4 to 27e94a
49 changes: 23 additions & 26 deletions Tool/Sources/XcodeInspector/XcodeInspector.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,23 @@ public final class XcodeInspector: ObservableObject {
@Published public internal(set) var activeXcode: XcodeAppInstanceInspector?
@Published public internal(set) var latestActiveXcode: XcodeAppInstanceInspector?
@Published public internal(set) var xcodes: [XcodeAppInstanceInspector] = []
@Published public internal(set) var activeProjectRootURL = URL(fileURLWithPath: "/")
@Published public internal(set) var activeDocumentURL = URL(fileURLWithPath: "/")
@Published public internal(set) var activeWorkspaceURL = URL(fileURLWithPath: "/")
@Published public internal(set) var activeProjectRootURL: URL? = nil
@Published public internal(set) var activeDocumentURL: URL? = nil
@Published public internal(set) var activeWorkspaceURL: URL? = nil
@Published public internal(set) var focusedWindow: XcodeWindowInspector?
@Published public internal(set) var focusedEditor: SourceEditor?
@Published public internal(set) var focusedElement: AXUIElement?
@Published public internal(set) var completionPanel: AXUIElement?

public var focusedEditorContent: EditorInformation? {
guard let documentURL = XcodeInspector.shared.realtimeActiveDocumentURL,
let workspaceURL = XcodeInspector.shared.realtimeActiveWorkspaceURL,
let projectURL = XcodeInspector.shared.activeProjectRootURL
else { return nil }

let editorContent = XcodeInspector.shared.focusedEditor?.content
let documentURL = XcodeInspector.shared.realtimeActiveDocumentURL
let workspaceURL = XcodeInspector.shared.realtimeActiveWorkspaceURL
let projectURL = XcodeInspector.shared.activeProjectRootURL
let language = languageIdentifierFromFileURL(documentURL)
let relativePath = documentURL.path
.replacingOccurrences(of: projectURL.path, with: "")
let relativePath = documentURL.path.replacingOccurrences(of: projectURL.path, with: "")

if let editorContent, let range = editorContent.selections.first {
let (selectedContent, selectedLines) = EditorInformation.code(
Expand Down Expand Up @@ -63,15 +64,15 @@ public final class XcodeInspector: ObservableObject {
)
}

public var realtimeActiveDocumentURL: URL {
public var realtimeActiveDocumentURL: URL? {
latestActiveXcode?.realtimeDocumentURL ?? activeDocumentURL
}
public var realtimeActiveWorkspaceURL: URL {

public var realtimeActiveWorkspaceURL: URL? {
latestActiveXcode?.realtimeWorkspaceURL ?? activeWorkspaceURL
}
public var realtimeActiveProjectURL: URL {

public var realtimeActiveProjectURL: URL? {
latestActiveXcode?.realtimeProjectURL ?? activeWorkspaceURL
}

Expand Down Expand Up @@ -192,7 +193,7 @@ public final class XcodeInspector: ObservableObject {
xcode.$documentURL.sink { [weak self] url in
self?.activeDocumentURL = url
}.store(in: &activeXcodeCancellable)

xcode.$workspaceURL.sink { [weak self] url in
self?.activeWorkspaceURL = url
}.store(in: &activeXcodeCancellable)
Expand Down Expand Up @@ -224,9 +225,9 @@ public class AppInstanceInspector: ObservableObject {

public final class XcodeAppInstanceInspector: AppInstanceInspector {
@Published public var focusedWindow: XcodeWindowInspector?
@Published public var documentURL: URL = .init(fileURLWithPath: "/")
@Published public var workspaceURL: URL = .init(fileURLWithPath: "/")
@Published public var projectRootURL: URL = .init(fileURLWithPath: "/")
@Published public var documentURL: URL? = nil
@Published public var workspaceURL: URL? = nil
@Published public var projectRootURL: URL? = nil
@Published public var workspaces = [WorkspaceIdentifier: Workspace]()
public var realtimeWorkspaces: [WorkspaceIdentifier: WorkspaceInfo] {
updateWorkspaceInfo()
Expand All @@ -238,25 +239,21 @@ public final class XcodeAppInstanceInspector: AppInstanceInspector {
public var realtimeDocumentURL: URL? {
guard let window = appElement.focusedWindow,
window.identifier == "Xcode.WorkspaceWindow"
else {
return nil
}
else { return nil }

return WorkspaceXcodeWindowInspector.extractDocumentURL(windowElement: window)
}

public var realtimeWorkspaceURL: URL? {
guard let window = appElement.focusedWindow,
window.identifier == "Xcode.WorkspaceWindow"
else {
return nil
}
else { return nil }

return WorkspaceXcodeWindowInspector.extractWorkspaceURL(windowElement: window)
}

public var realtimeProjectURL: URL? {
guard let window = appElement.focusedWindow else { return URL(fileURLWithPath: "/") }
guard let window = appElement.focusedWindow else { return nil }
let workspaceURL = realtimeWorkspaceURL
let documentURL = realtimeDocumentURL
return WorkspaceXcodeWindowInspector.extractProjectURL(
Expand Down