FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
CopilotForXcode/EditorExtension/AcceptPromptToCodeCommand.swift at main · github/CopilotForXcode · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
github
/
CopilotForXcode
Public
Notifications
You must be signed in to change notification settings
Fork
2k
Star
6.3k
Code
Issues
234
Pull requests
0
Discussions
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
CopilotForXcode
/
EditorExtension
/
AcceptPromptToCodeCommand.swift
Copy path
More file actions
More file actions
Latest commit
History
History
History
31 lines (29 loc) · 952 Bytes
Breadcrumbs
CopilotForXcode
/
EditorExtension
/
AcceptPromptToCodeCommand.swift
Copy path
File metadata and controls
31 lines (29 loc) · 952 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import
Client
import
Foundation
import
SuggestionBasic
import
XcodeKit
class
AcceptPromptToCodeCommand
:
NSObject
,
XCSourceEditorCommand
,
CommandType
{
var
name
:
String
{
"
Accept Prompt to Code
"
}
func
perform
(
with invocation
:
XCSourceEditorCommandInvocation
,
completionHandler
:
@escaping
(
Error
?
)
->
Void
)
{
Task
{
do
{
try
await
(
Task
(
timeout
:
7
)
{
let
service
=
try
getService
(
)
if
let
content
=
try
await
service
.
getPromptToCodeAcceptedCode
(
editorContent
:
.
init
(
invocation
)
)
{
invocation
.
accept
(
content
)
}
completionHandler
(
nil
)
}
.
value
)
}
catch
is
CancellationError
{
completionHandler
(
nil
)
}
catch
{
completionHandler
(
error
)
}
}
}
}
Back
|
FazBrowse Home
|
New Git URL