forked from github/CopilotForXcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.swift
More file actions
19 lines (15 loc) · 637 Bytes
/
Copy pathmain.swift
File metadata and controls
19 lines (15 loc) · 637 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import AppKit
import Foundation
class AppDelegate: NSObject, NSApplicationDelegate {}
let bundleIdentifierBase = Bundle(url: Bundle.main.bundleURL.appendingPathComponent(
"GitHub Copilot For Xcode Extension.app"
))?.object(forInfoDictionaryKey: "BUNDLE_IDENTIFIER_BASE") as? String ?? "com.github.CopilotForXcode"
let serviceIdentifier = bundleIdentifierBase + ".CommunicationBridge"
let appDelegate = AppDelegate()
let delegate = ServiceDelegate()
let listener = NSXPCListener(machServiceName: serviceIdentifier)
listener.delegate = delegate
listener.resume()
let app = NSApplication.shared
app.delegate = appDelegate
app.run()