File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -89,8 +89,6 @@ package struct RequestInfo: Sendable {
89
89
package init ( request: String ) throws {
90
90
var requestTemplate = request
91
91
92
- // If the request contained source text, remove it. We want to pick it up from the file on disk and most (possibly
93
- // all) sourcekitd requests use key.sourcefile if key.sourcetext is missing.
94
92
requestTemplate. replace ( #/ *key.sourcetext: .*\n/# , with: #"key.sourcetext: $FILE_CONTENTS\#n"# )
95
93
96
94
let sourceFilePath : URL
@@ -188,7 +186,7 @@ private func extractSourceFile(from requestTemplate: String) throws -> (template
188
186
switch ( sourceFilePath, namePath) {
189
187
case ( let sourceFilePath? , let namePath? ) :
190
188
if sourceFilePath != namePath {
191
- throw GenericError ( " Mismatching find key.sourcefile and key.name in the request " )
189
+ throw GenericError ( " Mismatching key.sourcefile and key.name in the request: \( sourceFilePath ) vs. \( namePath ) " )
192
190
}
193
191
return ( requestTemplate, URL ( fileURLWithPath: sourceFilePath) )
194
192
case ( let sourceFilePath? , nil ) :
Original file line number Diff line number Diff line change @@ -345,6 +345,8 @@ package actor SourceKitD {
345
345
case requests. codeCompleteClose:
346
346
contextualRequests [ documentUrl, default: [ ] ] . removeAll ( where: { $0. kind == . codeCompleteOpen } )
347
347
if contextualRequests [ documentUrl] ? . isEmpty ?? false {
348
+ // This should never happen because we should still have an active `.editorOpen` contextual request but just be
349
+ // safe in case we don't.
348
350
contextualRequests [ documentUrl] = nil
349
351
}
350
352
default :
You can’t perform that action at this time.
0 commit comments