forked from intitni/CopilotForXcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKeys.swift
More file actions
752 lines (590 loc) · 24.1 KB
/
Keys.swift
File metadata and controls
752 lines (590 loc) · 24.1 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
import AIModel
import Foundation
public protocol UserDefaultPreferenceKey {
associatedtype Value
var defaultValue: Value { get }
var key: String { get }
}
public struct PreferenceKey<T>: UserDefaultPreferenceKey {
public let defaultValue: T
public let key: String
public init(defaultValue: T, key: String) {
self.defaultValue = defaultValue
self.key = key
}
}
public struct DeprecatedPreferenceKey<T> {
public let defaultValue: T
public let key: String
public init(defaultValue: T, key: String) {
self.defaultValue = defaultValue
self.key = key
}
}
public struct FeatureFlag: UserDefaultPreferenceKey {
public let defaultValue: Bool
public let key: String
public init(defaultValue: Bool, key: String) {
self.defaultValue = defaultValue
self.key = key
}
}
public struct UserDefaultPreferenceKeys {
public init() {}
// MARK: Quit XPC Service On Xcode And App Quit
public let quitXPCServiceOnXcodeAndAppQuit = PreferenceKey(
defaultValue: true,
key: "QuitXPCServiceOnXcodeAndAppQuit"
)
// MARK: Automatically Check For Update
public let automaticallyCheckForUpdate = PreferenceKey(
defaultValue: false,
key: "AutomaticallyCheckForUpdate"
)
// MARK: Suggestion Widget Position Mode
public let suggestionWidgetPositionMode = PreferenceKey(
defaultValue: SuggestionWidgetPositionMode.fixedToBottom,
key: "SuggestionWidgetPositionMode"
)
// MARK: Widget Color Scheme
public let widgetColorScheme = PreferenceKey(
defaultValue: WidgetColorScheme.dark,
key: "WidgetColorScheme"
)
// MARK: Force Order Widget to Front
public let forceOrderWidgetToFront = PreferenceKey(
defaultValue: true,
key: "ForceOrderWidgetToFront"
)
// MARK: Prefer Widget to Stay Inside Editor When Width Greater Than
public let preferWidgetToStayInsideEditorWhenWidthGreaterThan = PreferenceKey(
defaultValue: 1400 as Double,
key: "PreferWidgetToStayInsideEditorWhenWidthGreaterThan"
)
// MARK: Hide Circular Widget
public let hideCircularWidget = PreferenceKey(
defaultValue: false,
key: "HideCircularWidget"
)
public let showHideWidgetShortcutGlobally = PreferenceKey(
defaultValue: false,
key: "ShowHideWidgetShortcutGlobally"
)
// MARK: Update Channel
public let installBetaBuilds = PreferenceKey(
defaultValue: false,
key: "InstallBetaBuilds"
)
}
// MARK: - OpenAI Account Settings
public extension UserDefaultPreferenceKeys {
var openAIAPIKey: DeprecatedPreferenceKey<String> {
.init(defaultValue: "", key: "OpenAIAPIKey")
}
var openAIBaseURL: DeprecatedPreferenceKey<String> {
.init(defaultValue: "", key: "OpenAIBaseURL")
}
var chatGPTModel: DeprecatedPreferenceKey<String> {
.init(defaultValue: ChatGPTModel.gpt35Turbo.rawValue, key: "ChatGPTModel")
}
var chatGPTMaxToken: DeprecatedPreferenceKey<Int> {
.init(defaultValue: 4000, key: "ChatGPTMaxToken")
}
var embeddingModel: DeprecatedPreferenceKey<String> {
.init(
defaultValue: OpenAIEmbeddingModel.textEmbeddingAda002.rawValue,
key: "OpenAIEmbeddingModel"
)
}
}
// MARK: - Azure OpenAI Settings
public extension UserDefaultPreferenceKeys {
var azureOpenAIAPIKey: DeprecatedPreferenceKey<String> {
.init(defaultValue: "", key: "AzureOpenAIAPIKey")
}
var azureOpenAIBaseURL: DeprecatedPreferenceKey<String> {
.init(defaultValue: "", key: "AzureOpenAIBaseURL")
}
var azureChatGPTDeployment: DeprecatedPreferenceKey<String> {
.init(defaultValue: "", key: "AzureChatGPTDeployment")
}
var azureEmbeddingDeployment: DeprecatedPreferenceKey<String> {
.init(defaultValue: "", key: "AzureEmbeddingDeployment")
}
}
// MARK: - GitHub Copilot Settings
public extension UserDefaultPreferenceKeys {
var gitHubCopilotVerboseLog: PreferenceKey<Bool> {
.init(defaultValue: false, key: "GitHubCopilotVerboseLog")
}
var gitHubCopilotProxyHost: PreferenceKey<String> {
.init(defaultValue: "", key: "GitHubCopilotProxyHost")
}
var gitHubCopilotProxyPort: PreferenceKey<String> {
.init(defaultValue: "", key: "GitHubCopilotProxyPort")
}
var gitHubCopilotEnterpriseURI: PreferenceKey<String> {
.init(defaultValue: "", key: "GitHubCopilotEnterpriseURI")
}
var gitHubCopilotUseStrictSSL: PreferenceKey<Bool> {
.init(defaultValue: true, key: "GitHubCopilotUseStrictSSL")
}
var gitHubCopilotProxyUsername: PreferenceKey<String> {
.init(defaultValue: "", key: "GitHubCopilotProxyUsername")
}
var gitHubCopilotProxyPassword: PreferenceKey<String> {
.init(defaultValue: "", key: "GitHubCopilotProxyPassword")
}
var nodePath: PreferenceKey<String> {
.init(defaultValue: "", key: "NodePath")
}
var runNodeWith: PreferenceKey<NodeRunner> {
.init(defaultValue: .env, key: "RunNodeWith")
}
var gitHubCopilotLoadKeyChainCertificates: PreferenceKey<Bool> {
.init(defaultValue: false, key: "GitHubCopilotLoadKeyChainCertificates")
}
var gitHubCopilotPretendIDEToBeVSCode: PreferenceKey<Bool> {
.init(defaultValue: false, key: "GitHubCopilotPretendIDEToBeVSCode")
}
}
// MARK: - Codeium Settings
public extension UserDefaultPreferenceKeys {
var codeiumVerboseLog: PreferenceKey<Bool> {
.init(defaultValue: false, key: "CodeiumVerboseLog")
}
var codeiumEnterpriseMode: PreferenceKey<Bool> {
.init(defaultValue: false, key: "CodeiumEnterpriseMode")
}
var codeiumPortalUrl: PreferenceKey<String> {
.init(defaultValue: "", key: "CodeiumPortalUrl")
}
var codeiumApiUrl: PreferenceKey<String> {
.init(defaultValue: "", key: "CodeiumApiUrl")
}
var codeiumEnterpriseVersion: PreferenceKey<String> {
.init(defaultValue: "", key: "CodeiumEnterpriseVersion")
}
var codeiumIndexEnabled: PreferenceKey<Bool> {
.init(defaultValue: false, key: "CodeiumIndexEnabled")
}
var codeiumIndexingMaxFileSize: PreferenceKey<Int> {
.init(defaultValue: 5000, key: "CodeiumIndexingMaxFileSize")
}
}
// MARK: - Chat Models
public extension UserDefaultPreferenceKeys {
var chatModels: PreferenceKey<[ChatModel]> {
.init(defaultValue: [
.init(
id: UUID().uuidString,
name: "OpenAI",
format: .openAI,
info: .init(
apiKeyName: "",
baseURL: "",
isFullURL: false,
maxTokens: ChatGPTModel.gpt35Turbo.maxToken,
supportsFunctionCalling: true,
modelName: ChatGPTModel.gpt35Turbo.rawValue
)
),
], key: "ChatModels")
}
var chatGPTLanguage: PreferenceKey<String> {
.init(defaultValue: "", key: "ChatGPTLanguage")
}
var chatGPTMaxMessageCount: PreferenceKey<Int> {
.init(defaultValue: 5, key: "ChatGPTMaxMessageCount")
}
var chatGPTTemperature: PreferenceKey<Double> {
.init(defaultValue: 0.7, key: "ChatGPTTemperature")
}
}
// MARK: - Embedding Models
public extension UserDefaultPreferenceKeys {
var embeddingModels: PreferenceKey<[EmbeddingModel]> {
.init(defaultValue: [
.init(
id: UUID().uuidString,
name: "OpenAI",
format: .openAI,
info: .init(
apiKeyName: "",
baseURL: "",
isFullURL: false,
maxTokens: OpenAIEmbeddingModel.textEmbeddingAda002.maxToken,
modelName: OpenAIEmbeddingModel.textEmbeddingAda002.rawValue
)
),
], key: "EmbeddingModels")
}
}
// MARK: - Prompt to Code
public extension UserDefaultPreferenceKeys {
var promptToCodeFeatureProvider: PreferenceKey<PromptToCodeFeatureProvider> {
.init(defaultValue: .openAI, key: "PromptToCodeFeatureProvider")
}
var promptToCodeGenerateDescription: PreferenceKey<Bool> {
.init(defaultValue: true, key: "PromptToCodeGenerateDescription")
}
var promptToCodeGenerateDescriptionInUserPreferredLanguage: PreferenceKey<Bool> {
.init(defaultValue: true, key: "PromptToCodeGenerateDescriptionInUserPreferredLanguage")
}
var promptToCodeChatModelId: PreferenceKey<String> {
.init(defaultValue: "", key: "PromptToCodeChatModelId")
}
var promptToCodeEmbeddingModelId: PreferenceKey<String> {
.init(defaultValue: "", key: "PromptToCodeEmbeddingModelId")
}
var enableSenseScopeByDefaultInPromptToCode: PreferenceKey<Bool> {
.init(defaultValue: false, key: "EnableSenseScopeByDefaultInPromptToCode")
}
var promptToCodeCodeFontSize: PreferenceKey<Double> {
.init(defaultValue: 13, key: "PromptToCodeCodeFontSize")
}
var hideCommonPrecedingSpacesInPromptToCode: PreferenceKey<Bool> {
.init(defaultValue: true, key: "HideCommonPrecedingSpacesInPromptToCode")
}
var wrapCodeInPromptToCode: PreferenceKey<Bool> {
.init(defaultValue: true, key: "WrapCodeInPromptToCode")
}
}
// MARK: - Suggestion
public extension UserDefaultPreferenceKeys {
var oldSuggestionFeatureProvider: DeprecatedPreferenceKey<BuiltInSuggestionFeatureProvider> {
.init(defaultValue: .gitHubCopilot, key: "SuggestionFeatureProvider")
}
var suggestionFeatureProvider: PreferenceKey<SuggestionFeatureProvider> {
.init(defaultValue: .builtIn(.gitHubCopilot), key: "NewSuggestionFeatureProvider")
}
var realtimeSuggestionToggle: PreferenceKey<Bool> {
.init(defaultValue: true, key: "RealtimeSuggestionToggle")
}
var suggestionDisplayCompactMode: PreferenceKey<Bool> {
.init(defaultValue: false, key: "SuggestionDisplayCompactMode")
}
var suggestionCodeFontSize: PreferenceKey<Double> {
.init(defaultValue: 13, key: "SuggestionCodeFontSize")
}
var disableSuggestionFeatureGlobally: PreferenceKey<Bool> {
.init(defaultValue: false, key: "DisableSuggestionFeatureGlobally")
}
var suggestionFeatureEnabledProjectList: PreferenceKey<[String]> {
.init(defaultValue: [], key: "SuggestionFeatureEnabledProjectList")
}
var suggestionFeatureDisabledLanguageList: PreferenceKey<[String]> {
.init(defaultValue: [], key: "SuggestionFeatureDisabledLanguageList")
}
var hideCommonPrecedingSpacesInSuggestion: PreferenceKey<Bool> {
.init(defaultValue: true, key: "HideCommonPrecedingSpacesInSuggestion")
}
var suggestionPresentationMode: PreferenceKey<PresentationMode> {
.init(defaultValue: .nearbyTextCursor, key: "SuggestionPresentationMode")
}
var realtimeSuggestionDebounce: PreferenceKey<Double> {
.init(defaultValue: 0.2, key: "RealtimeSuggestionDebounce")
}
var acceptSuggestionWithTab: PreferenceKey<Bool> {
.init(defaultValue: true, key: "AcceptSuggestionWithTab")
}
var acceptSuggestionWithModifierCommand: PreferenceKey<Bool> {
.init(defaultValue: false, key: "SuggestionWithModifierCommand")
}
var acceptSuggestionWithModifierOption: PreferenceKey<Bool> {
.init(defaultValue: false, key: "SuggestionWithModifierOption")
}
var acceptSuggestionWithModifierControl: PreferenceKey<Bool> {
.init(defaultValue: false, key: "SuggestionWithModifierControl")
}
var acceptSuggestionWithModifierShift: PreferenceKey<Bool> {
.init(defaultValue: false, key: "SuggestionWithModifierShift")
}
var acceptSuggestionWithModifierOnlyForSwift: PreferenceKey<Bool> {
.init(defaultValue: false, key: "SuggestionWithModifierOnlyForSwift")
}
var dismissSuggestionWithEsc: PreferenceKey<Bool> {
.init(defaultValue: true, key: "DismissSuggestionWithEsc")
}
var isSuggestionSenseEnabled: PreferenceKey<Bool> {
.init(defaultValue: false, key: "IsSuggestionSenseEnabled")
}
var isSuggestionTypeInTheMiddleEnabled: PreferenceKey<Bool> {
.init(defaultValue: true, key: "IsSuggestionTypeInTheMiddleEnabled")
}
}
// MARK: - Chat
public extension UserDefaultPreferenceKeys {
var chatFeatureProvider: DeprecatedPreferenceKey<ChatFeatureProvider> {
.init(defaultValue: .openAI, key: "ChatFeatureProvider")
}
var defaultChatFeatureChatModelId: PreferenceKey<String> {
.init(defaultValue: "", key: "DefaultChatFeatureChatModelId")
}
var embeddingFeatureProvider: DeprecatedPreferenceKey<EmbeddingFeatureProvider> {
.init(defaultValue: .openAI, key: "EmbeddingFeatureProvider")
}
var defaultChatFeatureEmbeddingModelId: PreferenceKey<String> {
.init(defaultValue: "", key: "DefaultChatFeatureEmbeddingModelId")
}
var chatFontSize: PreferenceKey<Double> {
.init(defaultValue: 12, key: "ChatFontSize")
}
var chatCodeFontSize: PreferenceKey<Double> {
.init(defaultValue: 12, key: "ChatCodeFontSize")
}
var useGlobalChat: PreferenceKey<Bool> {
.init(defaultValue: true, key: "UseGlobalChat")
}
var embedFileContentInChatContextIfNoSelection: PreferenceKey<Bool> {
.init(defaultValue: false, key: "EmbedFileContentInChatContextIfNoSelection")
}
var maxFocusedCodeLineCount: PreferenceKey<Int> {
.init(defaultValue: 100, key: "MaxEmbeddableFileInChatContextLineCount")
}
var useCodeScopeByDefaultInChatContext: DeprecatedPreferenceKey<Bool> {
.init(defaultValue: true, key: "UseSelectionScopeByDefaultInChatContext")
}
var defaultChatSystemPrompt: PreferenceKey<String> {
.init(
defaultValue: """
You are a helpful senior programming assistant.
You should respond in natural language.
Your response should be correct, concise, clear, informative and logical.
Use markdown if you need to present code, table, list, etc.
If you are asked to help perform a task, you MUST think step-by-step, then describe each step concisely.
If you are asked to explain code, you MUST explain it step-by-step in a ordered list concisely.
Make your answer short and structured.
""",
key: "DefaultChatSystemPrompt"
)
}
var chatSearchPluginMaxIterations: PreferenceKey<Int> {
.init(defaultValue: 3, key: "ChatSearchPluginMaxIterations")
}
var wrapCodeInChatCodeBlock: PreferenceKey<Bool> {
.init(defaultValue: true, key: "WrapCodeInChatCodeBlock")
}
var enableFileScopeByDefaultInChatContext: PreferenceKey<Bool> {
.init(defaultValue: true, key: "EnableFileScopeByDefaultInChatContext")
}
var enableCodeScopeByDefaultInChatContext: PreferenceKey<Bool> {
.init(defaultValue: true, key: "UseSelectionScopeByDefaultInChatContext")
}
var enableSenseScopeByDefaultInChatContext: PreferenceKey<Bool> {
.init(defaultValue: false, key: "EnableSenseScopeByDefaultInChatContext")
}
var enableProjectScopeByDefaultInChatContext: PreferenceKey<Bool> {
.init(defaultValue: false, key: "EnableProjectScopeByDefaultInChatContext")
}
var enableWebScopeByDefaultInChatContext: PreferenceKey<Bool> {
.init(defaultValue: false, key: "EnableWebScopeByDefaultInChatContext")
}
var preferredChatModelIdForSenseScope: PreferenceKey<String> {
.init(defaultValue: "", key: "PreferredChatModelIdForSenseScope")
}
var preferredChatModelIdForProjectScope: PreferenceKey<String> {
.init(defaultValue: "", key: "PreferredChatModelIdForProjectScope")
}
var preferredChatModelIdForWebScope: PreferenceKey<String> {
.init(defaultValue: "", key: "PreferredChatModelIdForWebScope")
}
var preferredChatModelIdForUtilities: PreferenceKey<String> {
.init(defaultValue: "", key: "PreferredChatModelIdForUtilities")
}
var disableFloatOnTopWhenTheChatPanelIsDetached: PreferenceKey<Bool> {
.init(defaultValue: true, key: "DisableFloatOnTopWhenTheChatPanelIsDetached")
}
var keepFloatOnTopIfChatPanelAndXcodeOverlaps: PreferenceKey<Bool> {
.init(defaultValue: true, key: "KeepFloatOnTopIfChatPanelAndXcodeOverlaps")
}
var openChatMode: PreferenceKey<OpenChatMode> {
.init(defaultValue: .chatPanel, key: "OpenChatMode")
}
var openChatInBrowserURL: PreferenceKey<String> {
.init(defaultValue: "", key: "OpenChatInBrowserURL")
}
var openChatInBrowserInInAppBrowser: PreferenceKey<Bool> {
.init(defaultValue: true, key: "OpenChatInBrowserInInAppBrowser")
}
}
// MARK: - Theme
public extension UserDefaultPreferenceKeys {
var syncSuggestionHighlightTheme: PreferenceKey<Bool> {
.init(defaultValue: false, key: "SyncSuggestionHighlightTheme")
}
var syncPromptToCodeHighlightTheme: PreferenceKey<Bool> {
.init(defaultValue: false, key: "SyncPromptToCodeHighlightTheme")
}
var syncChatCodeHighlightTheme: PreferenceKey<Bool> {
.init(defaultValue: false, key: "SyncChatCodeHighlightTheme")
}
var codeForegroundColorLight: PreferenceKey<UserDefaultsStorageBox<StorableColor?>> {
.init(defaultValue: .init(nil), key: "CodeForegroundColorLight")
}
var codeForegroundColorDark: PreferenceKey<UserDefaultsStorageBox<StorableColor?>> {
.init(defaultValue: .init(nil), key: "CodeForegroundColorDark")
}
var codeBackgroundColorLight: PreferenceKey<UserDefaultsStorageBox<StorableColor?>> {
.init(defaultValue: .init(nil), key: "CodeBackgroundColorLight")
}
var codeBackgroundColorDark: PreferenceKey<UserDefaultsStorageBox<StorableColor?>> {
.init(defaultValue: .init(nil), key: "CodeBackgroundColorDark")
}
var suggestionCodeFont: PreferenceKey<UserDefaultsStorageBox<StorableFont>> {
.init(
defaultValue: .init(.init(nsFont: .monospacedSystemFont(ofSize: 12, weight: .regular))),
key: "SuggestionCodeFont"
)
}
var promptToCodeCodeFont: PreferenceKey<UserDefaultsStorageBox<StorableFont>> {
.init(
defaultValue: .init(.init(nsFont: .monospacedSystemFont(ofSize: 12, weight: .regular))),
key: "PromptToCodeCodeFont"
)
}
var chatCodeFont: PreferenceKey<UserDefaultsStorageBox<StorableFont>> {
.init(
defaultValue: .init(.init(nsFont: .monospacedSystemFont(ofSize: 12, weight: .regular))),
key: "ChatCodeFont"
)
}
var terminalFont: PreferenceKey<UserDefaultsStorageBox<StorableFont>> {
.init(
defaultValue: .init(.init(nsFont: .monospacedSystemFont(ofSize: 12, weight: .regular))),
key: "TerminalCodeFont"
)
}
}
// MARK: - Bing Search
public extension UserDefaultPreferenceKeys {
var bingSearchSubscriptionKey: PreferenceKey<String> {
.init(defaultValue: "", key: "BingSearchSubscriptionKey")
}
var bingSearchEndpoint: PreferenceKey<String> {
.init(
defaultValue: "https://api.bing.microsoft.com/v7.0/search/",
key: "BingSearchEndpoint"
)
}
}
// MARK: - Custom Commands
public extension UserDefaultPreferenceKeys {
var customCommands: PreferenceKey<[CustomCommand]> {
.init(defaultValue: [
.init(
commandId: "BuiltInCustomCommandExplainSelection",
name: "Explain Selection",
feature: .chatWithSelection(
extraSystemPrompt: "",
prompt: "Explain the selected code concisely, step-by-step.",
useExtraSystemPrompt: true
)
),
.init(
commandId: "BuiltInCustomCommandAddDocumentationToSelection",
name: "Add Documentation to Selection",
feature: .promptToCode(
extraSystemPrompt: "",
prompt: "Add documentation on top of the code. Use triple slash if the language supports it.",
continuousMode: false,
generateDescription: true
)
),
.init(
commandId: "BuiltInCustomCommandSendCodeToChat",
name: "Send Selected Code to Chat",
feature: .chatWithSelection(
extraSystemPrompt: "",
prompt: """
```{{active_editor_language}}
{{selected_code}}
```
""",
useExtraSystemPrompt: true
)
),
], key: "CustomCommands")
}
}
// MARK: - Feature Flags
public extension UserDefaultPreferenceKeys {
var disableLazyVStack: FeatureFlag {
.init(defaultValue: false, key: "FeatureFlag-DisableLazyVStack")
}
var preCacheOnFileOpen: FeatureFlag {
.init(defaultValue: true, key: "FeatureFlag-PreCacheOnFileOpen")
}
var runNodeWithInteractiveLoggedInShell: FeatureFlag {
.init(defaultValue: true, key: "FeatureFlag-RunNodeWithInteractiveLoggedInShell")
}
var useCustomScrollViewWorkaround: FeatureFlag {
.init(defaultValue: false, key: "FeatureFlag-UseCustomScrollViewWorkaround")
}
var triggerActionWithAccessibilityAPI: FeatureFlag {
.init(defaultValue: true, key: "FeatureFlag-TriggerActionWithAccessibilityAPI")
}
var alwaysAcceptSuggestionWithAccessibilityAPI: FeatureFlag {
.init(defaultValue: false, key: "FeatureFlag-AlwaysAcceptSuggestionWithAccessibilityAPI")
}
var animationACrashSuggestion: FeatureFlag {
.init(defaultValue: true, key: "FeatureFlag-AnimationACrashSuggestion")
}
var animationBCrashSuggestion: FeatureFlag {
.init(defaultValue: true, key: "FeatureFlag-AnimationBCrashSuggestion")
}
var animationCCrashSuggestion: FeatureFlag {
.init(defaultValue: true, key: "FeatureFlag-AnimationCCrashSuggestion")
}
var enableXcodeInspectorDebugMenu: FeatureFlag {
.init(defaultValue: false, key: "FeatureFlag-EnableXcodeInspectorDebugMenu")
}
var disableFunctionCalling: FeatureFlag {
.init(defaultValue: false, key: "FeatureFlag-DisableFunctionCalling")
}
var useUserDefaultsBaseAPIKeychain: FeatureFlag {
.init(defaultValue: false, key: "FeatureFlag-UseUserDefaultsBaseAPIKeychain")
}
var disableGitHubCopilotSettingsAutoRefreshOnAppear: FeatureFlag {
.init(
defaultValue: false,
key: "FeatureFlag-DisableGitHubCopilotSettingsAutoRefreshOnAppear"
)
}
var disableGitIgnoreCheck: FeatureFlag {
.init(defaultValue: false, key: "FeatureFlag-DisableGitIgnoreCheck")
}
var disableFileContentManipulationByCheatsheet: FeatureFlag {
.init(defaultValue: true, key: "FeatureFlag-DisableFileContentManipulationByCheatsheet")
}
var disableEnhancedWorkspace: FeatureFlag {
.init(
defaultValue: false,
key: "FeatureFlag-DisableEnhancedWorkspace"
)
}
var restartXcodeInspectorIfAccessibilityAPIIsMalfunctioning: FeatureFlag {
.init(
defaultValue: false,
key: "FeatureFlag-RestartXcodeInspectorIfAccessibilityAPIIsMalfunctioning"
)
}
var restartXcodeInspectorIfAccessibilityAPIIsMalfunctioningNoTimer: FeatureFlag {
.init(
defaultValue: true,
key: "FeatureFlag-RestartXcodeInspectorIfAccessibilityAPIIsMalfunctioningNoTimer"
)
}
var toastForTheReasonWhyXcodeInspectorNeedsToBeRestarted: FeatureFlag {
.init(
defaultValue: false,
key: "FeatureFlag-ToastForTheReasonWhyXcodeInspectorNeedsToBeRestarted"
)
}
var observeToAXNotificationWithDefaultMode: FeatureFlag {
.init(defaultValue: false, key: "FeatureFlag-observeToAXNotificationWithDefaultMode")
}
var useCloudflareDomainNameForLicenseCheck: FeatureFlag {
.init(defaultValue: false, key: "FeatureFlag-UseCloudflareDomainNameForLicenseCheck")
}
}