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 {
8989 package init ( request: String ) throws {
9090 var requestTemplate = request
9191
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.
9492 requestTemplate. replace ( #/ *key.sourcetext: .*\n/# , with: #"key.sourcetext: $FILE_CONTENTS\#n"# )
9593
9694 let sourceFilePath : URL
@@ -188,7 +186,7 @@ private func extractSourceFile(from requestTemplate: String) throws -> (template
188186 switch ( sourceFilePath, namePath) {
189187 case ( let sourceFilePath? , let namePath? ) :
190188 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 ) " )
192190 }
193191 return ( requestTemplate, URL ( fileURLWithPath: sourceFilePath) )
194192 case ( let sourceFilePath? , nil ) :
Original file line number Diff line number Diff line change @@ -345,6 +345,8 @@ package actor SourceKitD {
345345 case requests. codeCompleteClose:
346346 contextualRequests [ documentUrl, default: [ ] ] . removeAll ( where: { $0. kind == . codeCompleteOpen } )
347347 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.
348350 contextualRequests [ documentUrl] = nil
349351 }
350352 default :
You can’t perform that action at this time.
0 commit comments