File tree Expand file tree Collapse file tree 3 files changed +7
-13
lines changed
Sources/SourceKitLSP/Swift Expand file tree Collapse file tree 3 files changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -180,12 +180,6 @@ extension SwiftLanguageService {
180
180
}
181
181
182
182
func expandMacro( macroExpansionURLData: MacroExpansionReferenceDocumentURLData ) async throws -> String {
183
- guard let sourceKitLSPServer = self . sourceKitLSPServer else {
184
- // `SourceKitLSPServer` has been destructed. We are tearing down the
185
- // language server. Nothing left to do.
186
- throw ResponseError . unknown ( " Connection to the editor closed " )
187
- }
188
-
189
183
let expandMacroCommand = ExpandMacroCommand (
190
184
positionRange: macroExpansionURLData. selectionRange,
191
185
textDocument: TextDocumentIdentifier ( macroExpansionURLData. primaryFile)
Original file line number Diff line number Diff line change @@ -59,12 +59,12 @@ package struct MacroExpansionReferenceDocumentURLData {
59
59
}
60
60
61
61
package init ( displayName: String , queryItems: [ URLQueryItem ] ) throws {
62
- guard let primaryFilePath = queryItems. last { $0. name == Parameters . primaryFilePath } ? . value,
63
- let fromLine = Int ( queryItems. last { $0. name == Parameters . fromLine } ? . value ?? " " ) ,
64
- let fromColumn = Int ( queryItems. last { $0. name == Parameters . fromColumn } ? . value ?? " " ) ,
65
- let toLine = Int ( queryItems. last { $0. name == Parameters . toLine } ? . value ?? " " ) ,
66
- let toColumn = Int ( queryItems. last { $0. name == Parameters . toColumn } ? . value ?? " " ) ,
67
- let bufferName = queryItems. last { $0. name == Parameters . bufferName } ? . value
62
+ guard let primaryFilePath = queryItems. last ( where : { $0. name == Parameters . primaryFilePath } ) ? . value,
63
+ let fromLine = Int ( queryItems. last ( where : { $0. name == Parameters . fromLine } ) ? . value ?? " " ) ,
64
+ let fromColumn = Int ( queryItems. last ( where : { $0. name == Parameters . fromColumn } ) ? . value ?? " " ) ,
65
+ let toLine = Int ( queryItems. last ( where : { $0. name == Parameters . toLine } ) ? . value ?? " " ) ,
66
+ let toColumn = Int ( queryItems. last ( where : { $0. name == Parameters . toColumn } ) ? . value ?? " " ) ,
67
+ let bufferName = queryItems. last ( where : { $0. name == Parameters . bufferName } ) ? . value
68
68
else {
69
69
throw ReferenceDocumentURLError ( description: " Invalid queryItems for macro expansion reference document url " )
70
70
}
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ package enum ReferenceDocumentURL {
78
78
throw ReferenceDocumentURLError (
79
79
description: " Bad URL for reference document: \( url) "
80
80
)
81
- default :
81
+ case let documentType ? :
82
82
throw ReferenceDocumentURLError (
83
83
description: " Invalid document type in URL for reference document: \( documentType) "
84
84
)
You can’t perform that action at this time.
0 commit comments