Fix issue that caused code completion to fail using compile_flags.txt

The compiler name shouldn’t be part of the build settings.
This commit is contained in:
Alex Hoppen
2025-03-13 14:21:21 -07:00
parent f9fc58da6d
commit b49b40968b
3 changed files with 25 additions and 8 deletions

View File

@@ -126,14 +126,8 @@ package actor FixedCompilationDatabaseBuildSystem: BuiltInBuildSystem {
package func sourceKitOptions(
request: TextDocumentSourceKitOptionsRequest
) async throws -> TextDocumentSourceKitOptionsResponse? {
let compilerName: String
switch request.language {
case .swift: compilerName = "swiftc"
case .c, .cpp, .objective_c, .objective_cpp: compilerName = "clang"
default: return nil
}
return TextDocumentSourceKitOptionsResponse(
compilerArguments: [compilerName] + compilerArgs + [request.textDocument.uri.pseudoPath],
compilerArguments: compilerArgs + [request.textDocument.uri.pseudoPath],
workingDirectory: try? configPath.deletingLastPathComponent().filePath
)
}