Skip to content

Commit 387063a

Browse files
committed
rename the command for action query
1 parent 0b25a6e commit 387063a

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

Sources/SourceKitBazelBSP/RequestHandlers/SKOptions/BazelTargetAquerier.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ final class BazelTargetAquerier {
6767
}
6868

6969
// Run the aquery on the special index output base since that's where we will build at.
70-
let output = try commandRunner.bazelIndexActionData(initializedConfig: config, cmd: cmd)
70+
let output = try commandRunner.bazelActionQuery(initializedConfig: config, cmd: cmd)
7171

7272
let parsedOutput = try BazelProtobufBindings.parseActionGraph(data: output)
7373

Sources/SourceKitBazelBSP/RequestHandlers/SKOptions/CompilerArgumentsProcessor.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ private let logger = makeFileLevelBSPLogger()
2525

2626
enum CompilerArgumentsProcessor {
2727
// Parses and processes the compilation step for a given target from a larger aquery output.
28-
// The parsing step is only necessary because BazelTargetAquerier operates on text. Should become unnecessary once we move to proto.
2928
static func extractAndProcessCompilerArgs(
3029
fromAquery aqueryOutput: Analysis_ActionGraphContainer,
3130
bazelTarget: String,

Sources/SourceKitBazelBSP/SharedUtils/Shell/CommandRunner.swift

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ extension CommandRunner {
4242
try run(baseConfig.bazelWrapper + " " + cmd, cwd: rootUri)
4343
}
4444

45-
func bazel(baseConfig: BaseServerConfig, rootUri: String, cmd: String) throws -> Data {
46-
try run(baseConfig.bazelWrapper + " " + cmd, cwd: rootUri)
47-
}
48-
4945
/// A regular bazel command, but at this BSP's special output base and taking into account the special index flags.
5046
func bazelIndexAction(initializedConfig: InitializedServerConfig, cmd: String) throws -> String {
5147
return try bazelIndexAction(
@@ -56,14 +52,16 @@ extension CommandRunner {
5652
)
5753
}
5854

59-
/// A regular bazel command, but at this BSP's special output base and taking into account the special index flags.
60-
func bazelIndexActionData(initializedConfig: InitializedServerConfig, cmd: String) throws -> Data {
61-
let additionalFlags = initializedConfig.baseConfig.indexFlags.joined(separator: " ")
62-
let baseConfig = initializedConfig.baseConfig
63-
let outputBase = initializedConfig.outputBase
64-
let rootUri = initializedConfig.rootUri
65-
let cmd = "--output_base=\(outputBase) \(cmd)\(additionalFlags)"
66-
return try bazel(baseConfig: baseConfig, rootUri: rootUri, cmd: cmd)
55+
/// A bazel action query command, but at this BSP's special output base and taking into account the special index flags.
56+
func bazelActionQuery(initializedConfig: InitializedServerConfig, cmd: String) throws -> Data {
57+
let baseCommand = [
58+
initializedConfig.baseConfig.bazelWrapper,
59+
"--output_base=\(initializedConfig.outputBase)",
60+
cmd,
61+
]
62+
let additionalFlags = initializedConfig.baseConfig.indexFlags
63+
let command = (baseCommand + additionalFlags).joined(separator: " ")
64+
return try run(command, cwd: initializedConfig.rootUri)
6765
}
6866

6967
/// A regular bazel command, but at this BSP's special output base and taking into account the special index flags.

0 commit comments

Comments
 (0)