Skip to content

Commit 29d2cf7

Browse files
committed
Update
1 parent f1d3f23 commit 29d2cf7

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

Tool/Sources/GitHubCopilotService/LanguageServer/GitHubCopilotService.swift

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,16 @@ public class GitHubCopilotBaseService {
167167
}
168168
}()
169169

170+
#if DEBUG
171+
let environment: [String: String] = [
172+
"GH_COPILOT_DEBUG_UI_PORT": "8080",
173+
"GH_COPILOT_VERBOSE": UserDefaults.shared.value(for: \.gitHubCopilotVerboseLog)
174+
? "true" : "false",
175+
]
176+
#else
177+
let environment = [String: String]()
178+
#endif
179+
170180
switch runner {
171181
case .bash:
172182
let nodePath = UserDefaults.shared.value(for: \.nodePath)
@@ -178,7 +188,7 @@ public class GitHubCopilotBaseService {
178188
executionParams = Process.ExecutionParameters(
179189
path: "/bin/bash",
180190
arguments: ["-i", "-l", "-c", command],
181-
environment: [:],
191+
environment: environment,
182192
currentDirectoryURL: urls.supportURL
183193
)
184194
case .shell:
@@ -192,7 +202,7 @@ public class GitHubCopilotBaseService {
192202
executionParams = Process.ExecutionParameters(
193203
path: shell,
194204
arguments: ["-i", "-l", "-c", command],
195-
environment: [:],
205+
environment: environment,
196206
currentDirectoryURL: urls.supportURL
197207
)
198208
case .env:
@@ -244,7 +254,10 @@ public class GitHubCopilotBaseService {
244254
initializationOptions: nil,
245255
capabilities: capabilities,
246256
trace: .off,
247-
workspaceFolders: nil
257+
workspaceFolders: [WorkspaceFolder(
258+
uri: projectRootURL.path,
259+
name: projectRootURL.lastPathComponent
260+
)]
248261
)
249262
}
250263

@@ -593,7 +606,7 @@ public final class GitHubCopilotService: GitHubCopilotBaseService,
593606
public func terminate() async {
594607
// automatically handled
595608
}
596-
609+
597610
public func cancelOngoingTask(workDoneToken: String) async {
598611
await localProcessServer?.cancelOngoingTask(workDoneToken: workDoneToken)
599612
}

0 commit comments

Comments
 (0)