Skip to content

Commit 749dc32

Browse files
committed
Remove scope settings from host app
1 parent 60e7592 commit 749dc32

File tree

3 files changed

+2
-322
lines changed

3 files changed

+2
-322
lines changed

Core/Sources/HostApp/FeatureSettings/Chat/ChatSettingsScopeSectionView.swift

Lines changed: 0 additions & 241 deletions
This file was deleted.

Core/Sources/HostApp/FeatureSettings/Chat/ChatSettingsView.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import SwiftUI
55
struct ChatSettingsView: View {
66
enum Tab {
77
case general
8-
case scopes
98
}
109

1110
@State var tabSelection: Tab = .general
@@ -14,7 +13,6 @@ struct ChatSettingsView: View {
1413
VStack(spacing: 0) {
1514
Picker("", selection: $tabSelection) {
1615
Text("General").tag(Tab.general)
17-
Text("Scopes").tag(Tab.scopes)
1816
}
1917
.pickerStyle(.segmented)
2018
.padding(8)
@@ -27,8 +25,6 @@ struct ChatSettingsView: View {
2725
switch tabSelection {
2826
case .general:
2927
ChatSettingsGeneralSectionView()
30-
case .scopes:
31-
ChatSettingsScopeSectionView()
3228
}
3329
}.padding()
3430
}

Core/Sources/HostApp/FeatureSettings/PromptToCodeSettingsView.swift

Lines changed: 2 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ import Preferences
22
import SharedUIComponents
33
import SwiftUI
44

5-
#if canImport(ProHostApp)
6-
import ProHostApp
7-
#endif
8-
95
struct 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

Comments
 (0)