@@ -315,6 +315,11 @@ extension SwiftPMBuildSystem: SKCore.BuildSystem {
315
315
public var indexPrefixMappings : [ PathPrefixMapping ] { return [ ] }
316
316
317
317
public func buildSettings( for uri: DocumentURI , language: Language ) throws -> FileBuildSettings ? {
318
+ // SwiftPMBuildSystem doesn't respect the langue specified by the editor.
319
+ return try buildSettings ( for: uri)
320
+ }
321
+
322
+ private func buildSettings( for uri: DocumentURI ) throws -> FileBuildSettings ? {
318
323
guard let url = uri. fileURL else {
319
324
// We can't determine build settings for non-file URIs.
320
325
return nil
@@ -335,7 +340,7 @@ extension SwiftPMBuildSystem: SKCore.BuildSystem {
335
340
}
336
341
337
342
if path. extension == " h " {
338
- return try settings ( forHeader: path, language )
343
+ return try settings ( forHeader: path)
339
344
}
340
345
341
346
return nil
@@ -432,14 +437,10 @@ extension SwiftPMBuildSystem: SKCore.BuildSystem {
432
437
}
433
438
434
439
public func fileHandlingCapability( for uri: DocumentURI ) -> FileHandlingCapability {
435
- guard let fileUrl = uri. fileURL else {
436
- return . unhandled
437
- }
438
- if ( try ? buildTarget ( for: AbsolutePath ( validating: fileUrl. path) ) ) != nil {
440
+ if ( try ? buildSettings ( for: uri) ) != nil {
439
441
return . handled
440
- } else {
441
- return . unhandled
442
442
}
443
+ return . unhandled
443
444
}
444
445
445
446
public func sourceFiles( ) -> [ SourceFileInfo ] {
@@ -491,7 +492,7 @@ extension SwiftPMBuildSystem {
491
492
/// file.
492
493
/// This is safe because all files within one target have the same build settings except for reference to the file
493
494
/// itself, which we are replacing.
494
- private func settings( forHeader path: AbsolutePath , _ language : Language ) throws -> FileBuildSettings ? {
495
+ private func settings( forHeader path: AbsolutePath ) throws -> FileBuildSettings ? {
495
496
func impl( _ path: AbsolutePath ) throws -> FileBuildSettings ? {
496
497
var dir = path. parentDirectory
497
498
while !dir. isRoot {
0 commit comments