@@ -315,6 +315,11 @@ extension SwiftPMBuildSystem: SKCore.BuildSystem {
315315 public var indexPrefixMappings : [ PathPrefixMapping ] { return [ ] }
316316
317317 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 ? {
318323 guard let url = uri. fileURL else {
319324 // We can't determine build settings for non-file URIs.
320325 return nil
@@ -335,7 +340,7 @@ extension SwiftPMBuildSystem: SKCore.BuildSystem {
335340 }
336341
337342 if path. extension == " h " {
338- return try settings ( forHeader: path, language )
343+ return try settings ( forHeader: path)
339344 }
340345
341346 return nil
@@ -432,14 +437,10 @@ extension SwiftPMBuildSystem: SKCore.BuildSystem {
432437 }
433438
434439 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 {
439441 return . handled
440- } else {
441- return . unhandled
442442 }
443+ return . unhandled
443444 }
444445
445446 public func sourceFiles( ) -> [ SourceFileInfo ] {
@@ -491,7 +492,7 @@ extension SwiftPMBuildSystem {
491492 /// file.
492493 /// This is safe because all files within one target have the same build settings except for reference to the file
493494 /// 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 ? {
495496 func impl( _ path: AbsolutePath ) throws -> FileBuildSettings ? {
496497 var dir = path. parentDirectory
497498 while !dir. isRoot {
0 commit comments