-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[Xcode] AI Tools & Improvements #17875
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[Xcode] AI Tools & Improvements #17875
Conversation
Due to API unavailability
Removed reference of searching Apple Developer Documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR adds extensive AI tools to the Xcode extension while removing the Search Developer Documentation command due to API issues, with significant improvements to project management and simulator controls.
- Added 14 new AI tools in
package.json
for managing Xcode projects, simulators, Swift packages, and cache clearing operations - Improved sorting of recent projects in
xcode-project.service.ts
by addinglastUsed
date tracking usingmdfind
'skMDItemLastUsedDate
- Added Swift version selection (5 or 6) when creating playgrounds in
xcode-swift-playground-creation-parameters.model.ts
- Removed all Apple Developer Documentation related files and functionality due to API issues (issue [Xcode]...Search documentation always fails with a syntax error #17795)
- Refactored simulator management to use UDIDs directly in
xcode-simulator.service.ts
for better decoupling
💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!
47 file(s) reviewed, 27 comment(s)
Edit PR Review Bot Settings | Greptile
extensions/xcode/package.json
Outdated
"tools": [ | ||
{ | ||
"name": "xcode-projects", | ||
"title": "Xcode Projects", | ||
"description": "The recently opened Xcode Projects, Swift Packages, Xcode Workspaces or Swift Playgrounds." | ||
}, | ||
{ | ||
"name": "xcode-swift-package-resolved", | ||
"title": "Swift Package Dependencies", | ||
"description": "The Swift Package dependencies of a Xcode Project, Xcode Workspace or Swift Package." | ||
}, | ||
{ | ||
"name": "xcode-simulators", | ||
"title": "Xcode Simulators", | ||
"description": "The installed Xcode Simulators." | ||
}, | ||
{ | ||
"name": "boot-xcode-simulator", | ||
"title": "Boot a Xcode Simulator", | ||
"description": "Boots the Xcode Simulator by its udid." | ||
}, | ||
{ | ||
"name": "shutdown-xcode-simulator", | ||
"title": "Shutdown a Xcode Simulator", | ||
"description": "Shutdowns the Xcode Simulator by its udid." | ||
}, | ||
{ | ||
"name": "restart-xcode-simulator", | ||
"title": "Restart a Xcode Simulator", | ||
"description": "Shutdowns the Xcode Simulator by its udid." | ||
}, | ||
{ | ||
"name": "open-url-in-xcode-simulator", | ||
"title": "Open a URL in a Xcode Simulator", | ||
"description": "Opens a URL in a Xcode Simulator either the a specific one identified by its udid or the currently booted one, if any." | ||
}, | ||
{ | ||
"name": "xcode-simulator-applications", | ||
"title": "Xcode Simulator Builds", | ||
"description": "The builds / apps installed on a Xcode simulator." | ||
}, | ||
{ | ||
"name": "xcode-releases", | ||
"title": "Xcode Releases", | ||
"description": "The releases of Xcode." | ||
}, | ||
{ | ||
"name": "xcode-add-swift-package", | ||
"title": "Add Swift Package", | ||
"description": "Adds a Swift Package to an Xcode project (*.xcodeproj) or Xcode workspace (*.xcworkspace) using its HTTPS or SSH URL." | ||
}, | ||
{ | ||
"name": "clear-derived-data", | ||
"title": "Clear Derived Data", | ||
"description": "Clears the derived data directory." | ||
}, | ||
{ | ||
"name": "clear-swift-package-manager-cache", | ||
"title": "Clear Swift Package Manager Cache", | ||
"description": "Clears the Swift Package Manager cache directory." | ||
}, | ||
{ | ||
"name": "clear-swift-ui-previews-cache", | ||
"title": "Clear SwiftUI Previews Cache", | ||
"description": "Clears the SwiftUI previews cache directory." | ||
}, | ||
{ | ||
"name": "open-path", | ||
"title": "Open Path", | ||
"description": "Opens a file path which either points to a file for example a Xcode Project (*.xcodeproj), Swift Package (Package.swift), Xcode Workspace (*.xcworkspace), Swift Playground (*.playground) or a directory." | ||
} | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Since tools section includes AI capabilities, it should also include 'ai' field with 'evals' inside
export default (input: Input) => | ||
XcodeSwiftPackageService.addSwiftPackage(input.swiftPackageUrl, input.xcodeProjectFilePath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Consider wrapping this in a try-catch block to handle potential errors when adding packages
export default (input: Input) => | |
XcodeSwiftPackageService.addSwiftPackage(input.swiftPackageUrl, input.xcodeProjectFilePath); | |
export default async (input: Input) => { | |
try { | |
await XcodeSwiftPackageService.addSwiftPackage(input.swiftPackageUrl, input.xcodeProjectFilePath); | |
} catch (error) { | |
await showFailureToast(error); | |
} | |
}; |
/** | ||
* Returns the Xcode releases. | ||
*/ | ||
export default () => XcodeReleaseService.xcodeReleases(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Consider wrapping the service call in a try-catch block to handle potential fetch errors gracefully
export default () => XcodeReleaseService.xcodeReleases(); | |
export default async () => { | |
try { | |
return await XcodeReleaseService.xcodeReleases(); | |
} catch (error) { | |
showFailureToast("Failed to fetch Xcode releases", error); | |
return []; | |
} | |
}; |
* Retrieves the Swift Package Resolved file for an Xcode project. | ||
* @param input The input. | ||
*/ | ||
export default (input: Input) => XcodeSwiftPackageResolvedService.getPackageResolved(input.xcodeProjectDirectoryPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Consider wrapping this in a try-catch block to handle potential errors when reading package resolved files
export default (input: Input) => XcodeSwiftPackageResolvedService.getPackageResolved(input.xcodeProjectDirectoryPath); | |
export default async (input: Input) => { | |
try { | |
return await XcodeSwiftPackageResolvedService.getPackageResolved(input.xcodeProjectDirectoryPath); | |
} catch (error) { | |
showFailureToast("Failed to read package resolved file", error); | |
return []; | |
} | |
}; |
/** | ||
* Returns the Xcode simulators. | ||
*/ | ||
export default () => XcodeSimulatorService.xcodeSimulators(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Missing return type annotation for better type safety
/** | ||
* Returns the Xcode Simulator applications / builds. | ||
*/ | ||
export default () => XcodeSimulatorApplicationService.xcodeSimulatorApplications(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Consider wrapping this call in a try-catch block to handle potential errors when accessing simulator applications
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Thank you for the update! 🎉 You can expect an initial review within five business days. |
…ments # Conflicts: # extensions/xcode/CHANGELOG.md
@pernielsentikaer any updates on this PR? |
It's up to our AI team to review AI extensions, but let me see if I can do it 😊 |
…ments # Conflicts: # extensions/xcode/CHANGELOG.md # extensions/xcode/src/services/xcode-simulator.service.ts
Description
AI Tools
This PR adds the following AI Tools to the Xcode Extension:
Xcode Projects
: Provides the AI with the recently opened Xcode Projects, Swift Packages, Xcode Workspaces or Swift Playgrounds.Swift Package Dependencies
: The Swift Package dependencies of a Xcode Project, Xcode Workspace or Swift Package.Xcode Simulators
: Provides the AI with the installed Xcode simulators.Boot a Xcode Simulator
: Ability to boot a simulator by its udid.Shutdowns a Xcode Simulator
: Ability to shutdown a simulator by its udid.Restart a Xcode Simulator
: Ability to restart a simulator by its udid.Open a URL in a Xcode Simulator
: Ability to open a URL in a simulator.Xcode Simulator Builds
: Provides the AI with the builds/apps installed on the Xcode simulators.Xcode Releases
: Provides the AI with the information about the releases of Xcode.Add Swift Package
: Adds a Swift Package to an Xcode project.Clear Derived Data
: Ability to clear the derived data directory.Clear Swift Package Manager
: Ability to clear the Swift Package Manager cache directory.Clear SwiftUI Previews Cache
: Ability to clear the SwiftUI Previews cache directory.Open Path
: Ability to open a Xcode project, Swift Package or directory."Search Developer Documentation" command removal
Removed the
Search Developer Documentation
command due to the unavailability of the underlying API (#17795)Improvements
Search Recent Projects
command to better sort the list of recent projects based on their last usage date.Checklist
npm run build
and tested this distribution build in Raycastassets
folder are used by the extension itselfREADME
are located outside the metadata folder if they were not generated with our metadata tool