Skip to content

Commit 1fd9b58

Browse files
committed
Add more descriptions to GitHub Copilot settings
1 parent 81f7207 commit 1fd9b58

3 files changed

Lines changed: 62 additions & 6 deletions

File tree

Core/Package.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ let package = Package(
119119
"LaunchAgentManager",
120120
"PlusFeatureFlag",
121121
.product(name: "Toast", package: "Tool"),
122+
.product(name: "SharedUIComponents", package: "Tool"),
122123
.product(name: "SuggestionModel", package: "Tool"),
123124
.product(name: "MarkdownUI", package: "swift-markdown-ui"),
124125
.product(name: "OpenAIService", package: "Tool"),

Core/Sources/HostApp/AccountSettings/CopilotView.swift

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import AppKit
22
import Client
33
import GitHubCopilotService
44
import Preferences
5+
import SharedUIComponents
56
import SuggestionModel
67
import SwiftUI
78

@@ -32,7 +33,7 @@ struct CopilotView: View {
3233
@Published var installationStep: GitHubCopilotInstallationManager.InstallationStep?
3334

3435
init() {}
35-
36+
3637
init(
3738
installationStatus: GitHubCopilotInstallationManager.InstallationStatus,
3839
installationStep: GitHubCopilotInstallationManager.InstallationStep?
@@ -142,10 +143,23 @@ struct CopilotView: View {
142143
HStack {
143144
VStack(alignment: .leading, spacing: 8) {
144145
Form {
145-
TextField(text: $settings.nodePath, prompt: Text("node")) {
146+
TextField(
147+
text: $settings.nodePath,
148+
prompt: Text(
149+
"node"
150+
)
151+
) {
146152
Text("Path to Node (v17+)")
147153
}
148154

155+
Text(
156+
"Provide the path to the executable if it can't be found by the app, shim executable is not supported"
157+
)
158+
.lineLimit(10)
159+
.foregroundColor(.secondary)
160+
.font(.callout)
161+
.dynamicHeightTextInFormWorkaround()
162+
149163
Picker(selection: $settings.runNodeWith) {
150164
ForEach(NodeRunner.allCases, id: \.rawValue) { runner in
151165
switch runner {
@@ -160,11 +174,28 @@ struct CopilotView: View {
160174
} label: {
161175
Text("Run Node with")
162176
}
177+
178+
Group {
179+
switch settings.runNodeWith {
180+
case .env:
181+
Text(
182+
"PATH: `/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin`"
183+
)
184+
case .bash:
185+
Text("PATH inherited from bash configurations.")
186+
case .shell:
187+
Text("PATH inherited from $SHELL configurations.")
188+
}
189+
}
190+
.lineLimit(10)
191+
.foregroundColor(.secondary)
192+
.font(.callout)
193+
.dynamicHeightTextInFormWorkaround()
163194
}
164195

165-
Text(
166-
"You may have to restart the helper app to apply the changes. To do so, simply close the helper app by clicking on the menu bar icon that looks like a steer wheel, it will automatically restart as needed."
167-
)
196+
Text("""
197+
You may have to restart the helper app to apply the changes. To do so, simply close the helper app by clicking on the menu bar icon that looks like a tentacle, it will automatically restart as needed.
198+
""")
168199
.lineLimit(6)
169200
.fixedSize(horizontal: false, vertical: true)
170201
.foregroundColor(.secondary)
@@ -236,9 +267,16 @@ struct CopilotView: View {
236267

237268
Form {
238269
Toggle(
239-
"Ignore Trailing New Lines and Whitespaces",
270+
"Remove Extra New Lines Generated by GitHub Copilot",
240271
isOn: $settings.gitHubCopilotIgnoreTrailingNewLines
241272
)
273+
Text(
274+
"Sometimes GitHub Copilot may generate extra unwanted new lines at the end of a suggestion. If you don't like that, you can turn this toggle on."
275+
)
276+
.lineLimit(10)
277+
.foregroundColor(.secondary)
278+
.font(.callout)
279+
.dynamicHeightTextInFormWorkaround()
242280
Toggle("Verbose Log", isOn: $settings.gitHubCopilotVerboseLog)
243281
}
244282

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import SwiftUI
2+
3+
struct DynamicHeightTextInFormWorkaroundModifier: ViewModifier {
4+
func body(content: Content) -> some View {
5+
HStack(spacing: 0) {
6+
content
7+
Spacer()
8+
}
9+
.fixedSize(horizontal: false, vertical: true)
10+
}
11+
}
12+
13+
public extension View {
14+
func dynamicHeightTextInFormWorkaround() -> some View {
15+
modifier(DynamicHeightTextInFormWorkaroundModifier())
16+
}
17+
}

0 commit comments

Comments
 (0)