Skip to content

Commit 9339791

Browse files
committed
Set useNewAPI when closing a code completion session
Otherwise, the close does not get handled by the SourceKit plugin. In practice, it doesn’t matter too much because the SourceKit plugin will implicitly close the last completion session when a new one is opened but we should fix this.
1 parent b3a73f6 commit 9339791

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Sources/SourceKitLSP/Swift/CodeCompletionSession.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ class CodeCompletionSession {
374374
keys.column: sourcekitdPosition.utf8Column,
375375
keys.sourceFile: snapshot.uri.pseudoPath,
376376
keys.name: snapshot.uri.pseudoPath,
377+
keys.codeCompleteOptions: [keys.useNewAPI: 1],
377378
])
378379
logger.info("Closing code completion session: \(self.description)")
379380
_ = try? await sourcekitd.send(req, timeout: options.sourcekitdRequestTimeoutOrDefault, fileContents: nil)

0 commit comments

Comments
 (0)