File tree 1 file changed +6
-5
lines changed
Sources/SourceKitLSP/Swift
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -22,20 +22,21 @@ import SwiftExtensions
22
22
import SwiftParser
23
23
@_spi ( SourceKitLSP) import SwiftRefactor
24
24
import SwiftSyntax
25
+ import Synchronization
25
26
26
27
/// Uniquely identifies a code completion session. We need this so that when resolving a code completion item, we can
27
28
/// verify that the item to resolve belongs to the code completion session that is currently open.
28
29
struct CompletionSessionID : Equatable {
29
- private static let nextSessionID = AtomicUInt32 ( initialValue : 0 )
30
+ private static let nextSessionID : Atomic < Int > = Atomic ( 0 )
30
31
31
- let value : UInt32
32
+ let value : Int
32
33
33
- init ( value: UInt32 ) {
34
+ init ( value: Int ) {
34
35
self . value = value
35
36
}
36
37
37
38
static func next( ) -> CompletionSessionID {
38
- return CompletionSessionID ( value: nextSessionID. fetchAndIncrement ( ) )
39
+ return CompletionSessionID ( value: nextSessionID. add ( 1 , ordering : . sequentiallyConsistent ) . oldValue )
39
40
}
40
41
}
41
42
@@ -60,7 +61,7 @@ struct CompletionItemData: LSPAnyCodable {
60
61
return nil
61
62
}
62
63
self . uri = uri
63
- self . sessionId = CompletionSessionID ( value: UInt32 ( sessionId) )
64
+ self . sessionId = CompletionSessionID ( value: sessionId)
64
65
self . itemId = itemId
65
66
}
66
67
You can’t perform that action at this time.
0 commit comments