We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 45d24a8 commit f97e41bCopy full SHA for f97e41b
Sources/SourceKitLSP/Swift/SyntaxHighlightingTokens.swift
@@ -62,6 +62,11 @@ public struct SyntaxHighlightingTokens {
62
return SyntaxHighlightingTokens(tokens: tokens.filter { !otherRanges.contains($0.range) } + other.tokens)
63
}
64
65
+ public func mergingTokens(with other: [SyntaxHighlightingToken]) -> SyntaxHighlightingTokens {
66
+ let otherRanges = Set(other.map(\.range))
67
+ return SyntaxHighlightingTokens(tokens: tokens.filter { !otherRanges.contains($0.range) } + other)
68
+ }
69
+
70
/// Sorts the tokens in this array by their start position.
71
public func sorted(_ areInIncreasingOrder: (SyntaxHighlightingToken, SyntaxHighlightingToken) -> Bool)
72
-> SyntaxHighlightingTokens
0 commit comments