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
21 lines (17 loc) · 715 Bytes
/
main.swift
File metadata and controls
21 lines (17 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import AppKit
import Foundation
import Logger
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
Logger.communicationBridge.info("Communication bridge started")
app.run()