File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Sources/SourceKitLSP/Swift Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -22,20 +22,21 @@ import SwiftExtensions
2222import SwiftParser
2323@_spi ( SourceKitLSP) import SwiftRefactor
2424import SwiftSyntax
25+ import Synchronization
2526
2627/// Uniquely identifies a code completion session. We need this so that when resolving a code completion item, we can
2728/// verify that the item to resolve belongs to the code completion session that is currently open.
2829struct CompletionSessionID : Equatable {
29- private static let nextSessionID = AtomicUInt32 ( initialValue : 0 )
30+ private static let nextSessionID : Atomic < Int > = Atomic ( 0 )
3031
31- let value : UInt32
32+ let value : Int
3233
33- init ( value: UInt32 ) {
34+ init ( value: Int ) {
3435 self . value = value
3536 }
3637
3738 static func next( ) -> CompletionSessionID {
38- return CompletionSessionID ( value: nextSessionID. fetchAndIncrement ( ) )
39+ return CompletionSessionID ( value: nextSessionID. add ( 1 , ordering : . sequentiallyConsistent ) . oldValue )
3940 }
4041}
4142
@@ -60,7 +61,7 @@ struct CompletionItemData: LSPAnyCodable {
6061 return nil
6162 }
6263 self . uri = uri
63- self . sessionId = CompletionSessionID ( value: UInt32 ( sessionId) )
64+ self . sessionId = CompletionSessionID ( value: sessionId)
6465 self . itemId = itemId
6566 }
6667
You can’t perform that action at this time.
0 commit comments