File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Sources/SourceKitLSP/Swift Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ public struct SyntaxHighlightingTokens {
27
27
public var lspEncoded : [ UInt32 ] {
28
28
var previous = Position ( line: 0 , utf16index: 0 )
29
29
var rawTokens : [ UInt32 ] = [ ]
30
- rawTokens. reserveCapacity ( count * 5 )
30
+ rawTokens. reserveCapacity ( tokens . count * 5 )
31
31
32
32
for token in self . tokens {
33
33
let lineDelta = token. start. line - previous. line
@@ -80,7 +80,7 @@ extension SyntaxHighlightingTokens {
80
80
public init ( lspEncodedTokens rawTokens: [ UInt32 ] ) {
81
81
self . init ( tokens: [ ] )
82
82
assert ( rawTokens. count. isMultiple ( of: 5 ) )
83
- reserveCapacity ( rawTokens. count / 5 )
83
+ self . tokens . reserveCapacity ( rawTokens. count / 5 )
84
84
85
85
var current = Position ( line: 0 , utf16index: 0 )
86
86
@@ -102,12 +102,12 @@ extension SyntaxHighlightingTokens {
102
102
let kind = SemanticTokenTypes . all [ Int ( rawKind) ]
103
103
let modifiers = SemanticTokenModifiers ( rawValue: rawModifiers)
104
104
105
- self . tokens += SyntaxHighlightingToken (
105
+ self . tokens. append ( SyntaxHighlightingToken (
106
106
start: current,
107
107
utf16length: length,
108
108
kind: kind,
109
109
modifiers: modifiers
110
- )
110
+ ) )
111
111
}
112
112
}
113
113
}
You can’t perform that action at this time.
0 commit comments