mirror of
https://github.com/apple/sourcekit-lsp.git
synced 2026-03-02 18:23:24 +01:00
This is an implementation of LSP's semantic tokens for Swift. Both lexical and semantic tokens are provided by using the syntaxmap and the semantic annotations provided as part of SourceKit's open responses and document update notifications. While lexical tokens are parsed and stored in the DocumentManager synchronously, semantic tokens are provided asynchronously. If an edit occurs, tokens are automatically shifted by the DocumentManager. This is especially relevant for lexical tokens, which are updated in deltas. In addition, unit tests are added that assert that both lexical and semantic tokens are provided and shifted correctly upon edits.