Swift grammar for tree-sitter, providing incremental parsing, syntax highlighting, and code analysis for the Swift programming language. Current version: 0.7.2. Released irregularly, with updates following Swift language evolution and tree-sitter releases.
pip install tree-sitter-swiftNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Create a parser with the Swift language and parse a simple Swift snippet.
Update tree-sitter to >=0.23.0: pip install 'tree-sitter>=0.23'
Replace `from tree_sitter_swift import Language` with `from tree_sitter_swift import language` and call `language()`.
Re-create the parser and load the grammar after deserialization instead of pickling the parser directly.
Change import to: from tree_sitter_swift import language
Use the newer API: parser = ts.Parser(language())
Ensure you have Rust installed to compile from source, or use a version that supports your platform: pip install 'tree-sitter-swift>=0.7'