Skip to content

Commit 5c78d0b

Browse files
committed
Remove now-unnecessary chmod call
1 parent 770b4e2 commit 5c78d0b

File tree

3 files changed

+3
-35
lines changed

3 files changed

+3
-35
lines changed

Sources/SourceKitBazelBSP/RequestHandlers/PrepareHandler.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,6 @@ final class PrepareHandler {
9595
cmd: "build \(labelsToBuild.joined(separator: " "))"
9696
)
9797

98-
// FIXME: This might not be necessary anymore
99-
// _ = try commandRunner.run("chmod -R 777 \(initializedConfig.outputBase)")
100-
10198
logger.info("Finished building targets!")
10299
}
103100
}

Sources/SourceKitBazelBSP/Server/SourceKitBazelBSPServer.swift

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -95,20 +95,7 @@ package final class SourceKitBazelBSPServer {
9595
targetStore: targetStore,
9696
connection: connection
9797
)
98-
registry.register(requestHandler: { (request: TextDocumentSourceKitOptionsRequest, id: RequestID) in
99-
// Handle the optional response type properly - if nil is returned for valid reasons
100-
// (like missing module entries), return an empty response instead of nil to prevent connection closure
101-
if let response = try skOptionsHandler.textDocumentSourceKitOptions(request, id) {
102-
return response
103-
} else {
104-
// Return an empty response with no compiler arguments rather than nil
105-
// This prevents SourceKit LSP from closing the connection
106-
return TextDocumentSourceKitOptionsResponse(
107-
compilerArguments: [],
108-
workingDirectory: initializedConfig.rootUri
109-
)
110-
}
111-
})
98+
registry.register(requestHandler: skOptionsHandler.textDocumentSourceKitOptions)
11299

113100
// buildTarget/prepare
114101
let prepareHandler = PrepareHandler(

Tests/SourceKitBazelBSPTests/PrepareHandlerTests.swift

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@ import Testing
5454
for: expectedCommand,
5555
response: "")
5656

57-
let chmodCommand = "chmod -R 777 /tmp/output_base"
58-
commandRunner.setResponse(
59-
for: chmodCommand,
60-
response: ""
61-
)
62-
6357
let handler = PrepareHandler(
6458
initializedConfig: initializedConfig,
6559
targetStore: BazelTargetStore(initializedConfig: initializedConfig),
@@ -70,11 +64,9 @@ import Testing
7064
try handler.build(bazelLabels: baseConfig.targets)
7165

7266
let ranCommands = commandRunner.commands
73-
#expect(ranCommands.count == 2)
67+
#expect(ranCommands.count == 1)
7468
#expect(ranCommands[0].command == expectedCommand)
7569
#expect(ranCommands[0].cwd == "/path/to/project")
76-
#expect(ranCommands[1].command == chmodCommand)
77-
#expect(ranCommands[1].cwd == nil)
7870
}
7971

8072
func buildWithMultipleTargets() throws {
@@ -104,12 +96,6 @@ import Testing
10496
for: expectedCommand,
10597
response: "Build completed")
10698

107-
let chmodCommand = "chmod -R 777 /tmp/output_base"
108-
commandRunner.setResponse(
109-
for: chmodCommand,
110-
response: "Done"
111-
)
112-
11399
let handler = PrepareHandler(
114100
initializedConfig: initializedConfig,
115101
targetStore: BazelTargetStore(initializedConfig: initializedConfig),
@@ -120,10 +106,8 @@ import Testing
120106
try handler.build(bazelLabels: baseConfig.targets)
121107

122108
let ranCommands = commandRunner.commands
123-
#expect(ranCommands.count == 2)
109+
#expect(ranCommands.count == 1)
124110
#expect(ranCommands[0].command == expectedCommand)
125111
#expect(ranCommands[0].cwd == "/path/to/project")
126-
#expect(ranCommands[1].command == chmodCommand)
127-
#expect(ranCommands[1].cwd == nil)
128112
}
129113
}

0 commit comments

Comments
 (0)