Skip to content

Commit b372182

Browse files
author
Wang Lun
committed
revert unnecessary changes
1 parent c9a943e commit b372182

File tree

3 files changed

+4
-22
lines changed

3 files changed

+4
-22
lines changed

Sources/SKTestSupport/Utils.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ extension Language {
3232
case "cpp": self = .cpp
3333
case "m": self = .objective_c
3434
case "mm": self = .objective_cpp
35-
case "swift", "swiftinterface": self = .swift
35+
case "swift": self = .swift
3636
case "md": self = .markdown
3737
case "tutorial": self = .tutorial
3838
default: return nil

Sources/SourceKitLSP/Swift/GeneratedInterfaceDocumentURLData.swift

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,7 @@ package struct GeneratedInterfaceDocumentURLData: Hashable, ReferenceURLData {
6767
self.moduleName = moduleName
6868
self.groupName = groupName
6969
self.sourcekitdDocumentName = sourcekitdDocumentName
70-
if let referenceDocumentURL = try? ReferenceDocumentURL(from: primaryFile),
71-
let fileURL = referenceDocumentURL.buildSettingsFile.fileURL {
72-
self.buildSettingsFrom = DocumentURI(fileURL)
73-
} else if let fileURL = primaryFile.fileURL {
74-
self.buildSettingsFrom = DocumentURI(fileURL)
75-
} else {
76-
self.buildSettingsFrom = primaryFile
77-
}
70+
self.buildSettingsFrom = primaryFile.buildSettingsFile
7871
}
7972

8073
init(queryItems: [URLQueryItem]) throws {

Sources/SourceKitLSP/Swift/ReferenceDocumentURL.swift

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -122,25 +122,14 @@ package enum ReferenceDocumentURL {
122122
var buildSettingsFile: DocumentURI {
123123
switch self {
124124
case .macroExpansion(let data): return data.primaryFile
125-
case .generatedInterface(let data):
126-
if let referenceDocumentURL = try? ReferenceDocumentURL(from: data.buildSettingsFrom),
127-
let fileURL = referenceDocumentURL.buildSettingsFile.fileURL {
128-
return DocumentURI(fileURL)
129-
}
130-
return data.buildSettingsFrom
125+
case .generatedInterface(let data): return data.buildSettingsFrom
131126
}
132127
}
133128

134129
var primaryFile: DocumentURI? {
135130
switch self {
136131
case .macroExpansion(let data): return data.primaryFile
137-
case .generatedInterface(let data):
138-
if let referenceDocumentURL = try? ReferenceDocumentURL(from: data.buildSettingsFrom),
139-
let primaryFile = referenceDocumentURL.primaryFile,
140-
let fileURL = primaryFile.fileURL {
141-
return DocumentURI(fileURL)
142-
}
143-
return data.buildSettingsFrom.primaryFile
132+
case .generatedInterface(let data): return data.buildSettingsFrom.primaryFile
144133
}
145134
}
146135
}

0 commit comments

Comments
 (0)