`SemanticTokensManager` should not have `DocumentSnapshot.ID` as key
ahoppen opened this issue · comments
Alex Hoppen commented
I suspect we'll not have all that many documents, but given we only ever keep the latest this could just be eg.
struct VersionedTokens {
let version: Int
let tokens: [SyntaxHighlightingToken]
}
...
private var semanticTokens: [DocumentURI: VersionedTokens]
Then the discard is just semanticTokens.removeValue(uri)
and setSemanticTokens
would just check if the version is less than the one stored (if any), then set.
Assuming that is that we do only want the latest, right now we could technically store version 5 then 4 and we'd have both (but 4 then 5 would only have 5).
Alex Hoppen commented
Tracked in Apple’s issue tracker as rdar://116705694
Alex Hoppen commented
SemanticTokensManager
no longer exists.