File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Sources/SwiftLanguageService Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -24,9 +24,8 @@ extension SwiftLanguageService {
24
24
) async throws -> GeneratedInterfaceDetails ? {
25
25
// Include build settings context to distinguish different versions/configurations
26
26
let buildSettingsFileHash = " \( abs ( document. buildSettingsFile. stringValue. hashValue) ) "
27
- let sourcekitdDocumentName = [ moduleName, groupName, buildSettingsFileHash] . compactMap ( \. self) . joined (
28
- separator: " . "
29
- )
27
+ let sourcekitdDocumentName = [ moduleName, groupName, buildSettingsFileHash] . compactMap ( \. self)
28
+ . joined ( separator: " . " )
30
29
31
30
let urlData = GeneratedInterfaceDocumentURLData (
32
31
moduleName: moduleName,
@@ -46,7 +45,13 @@ extension SwiftLanguageService {
46
45
if self . capabilityRegistry. clientHasExperimentalCapability ( GetReferenceDocumentRequest . method) {
47
46
return GeneratedInterfaceDetails ( uri: try urlData. uri, position: position)
48
47
}
49
- let interfaceFilePath = self . generatedInterfacesPath. appendingPathComponent ( urlData. displayName)
48
+ let interfaceFilePath = self . generatedInterfacesPath
49
+ . appendingPathComponent ( buildSettingsFileHash)
50
+ . appendingPathComponent ( urlData. displayName)
51
+ try FileManager . default. createDirectory (
52
+ at: interfaceFilePath. deletingLastPathComponent ( ) ,
53
+ withIntermediateDirectories: true
54
+ )
50
55
try await generatedInterfaceManager. snapshot ( of: urlData) . text. write (
51
56
to: interfaceFilePath,
52
57
atomically: true ,
You can’t perform that action at this time.
0 commit comments