@@ -2,10 +2,6 @@ import Preferences
22import SharedUIComponents
33import SwiftUI
44
5- #if canImport(ProHostApp)
6- import ProHostApp
7- #endif
8-
95struct PromptToCodeSettingsView : View {
106 final class Settings : ObservableObject {
117 @AppStorage ( \. hideCommonPrecedingSpacesInPromptToCode)
@@ -53,28 +49,6 @@ struct PromptToCodeSettingsView: View {
5349 }
5450 }
5551
56- Picker (
57- " Embedding model " ,
58- selection: $settings. promptToCodeEmbeddingModelId
59- ) {
60- Text ( " Same as chat feature " ) . tag ( " " )
61-
62- if !settings. embeddingModels
63- . contains ( where: { $0. id == settings. promptToCodeEmbeddingModelId } ) ,
64- !settings. promptToCodeEmbeddingModelId. isEmpty
65- {
66- Text (
67- ( settings. embeddingModels. first? . name) . map { " \( $0) (Default) " }
68- ?? " No model found "
69- )
70- . tag ( settings. promptToCodeEmbeddingModelId)
71- }
72-
73- ForEach ( settings. embeddingModels, id: \. id) { embeddingModel in
74- Text ( embeddingModel. name) . tag ( embeddingModel. id)
75- }
76- }
77-
7852 Toggle ( isOn: $settings. promptToCodeGenerateDescription) {
7953 Text ( " Generate description " )
8054 }
@@ -90,66 +64,17 @@ struct PromptToCodeSettingsView: View {
9064 Toggle ( isOn: $settings. hideCommonPrecedingSpaces) {
9165 Text ( " Hide common preceding spaces " )
9266 }
93-
67+
9468 Toggle ( isOn: $settings. wrapCode) {
9569 Text ( " Wrap code " )
9670 }
9771
9872 CodeHighlightThemePicker ( scenario: . promptToCode)
99-
73+
10074 FontPicker ( font: $settings. font) {
10175 Text ( " Font " )
10276 }
10377 }
104-
105- ScopeForm ( )
106- }
107- }
108-
109- struct ScopeForm : View {
110- class Settings : ObservableObject {
111- @AppStorage ( \. enableSenseScopeByDefaultInPromptToCode)
112- var enableSenseScopeByDefaultInPromptToCode : Bool
113- init ( ) { }
114- }
115-
116- @StateObject var settings = Settings ( )
117-
118- var body : some View {
119- SettingsDivider ( " Scopes " )
120-
121- VStack {
122- #if canImport(ProHostApp)
123-
124- SubSection (
125- title: Text ( " Sense Scope (Experimental) " ) ,
126- description: IfFeatureEnabled ( \. senseScopeInChat) {
127- Text ( """
128- Enable the bot to access the relevant code \
129- of the editing document in the project, third party packages and the SDK.
130- """ )
131- } else: {
132- VStack ( alignment: . leading) {
133- Text ( """
134- Enable the bot to read the relevant code \
135- of the editing document in the SDK, and
136- """ )
137-
138- WithFeatureEnabled ( \. senseScopeInChat, alignment: . inlineLeading) {
139- Text ( " the project and third party packages. " )
140- }
141- }
142- }
143- ) {
144- Form {
145- Toggle ( isOn: $settings. enableSenseScopeByDefaultInPromptToCode) {
146- Text ( " Enable by default " )
147- }
148- }
149- }
150-
151- #endif
152- }
15378 }
15479 }
15580}
0 commit comments