Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.
Python aicode-complexitycode-healthcode-intelligencecode-qualitydead-codedeveloper-toolsdocumentationgit-analyticsmcpopen-sourcepythonrefactoringstatic-analysistechnical-debt
chore(deps): bump tree-sitter-swift to 0.7.4 (#3647)
Swati Ahuja06440a0ec7d8
diff --git a/packages/core/src/repowise/core/ingestion/queries/swift.scm b/packages/core/src/repowise/core/ingestion/queries/swift.scmindex e1794f989..07cf3c780 100644--- a/packages/core/src/repowise/core/ingestion/queries/swift.scm+++ b/packages/core/src/repowise/core/ingestion/queries/swift.scm@@ -102,3 +102,23 @@(value_arguments "(") @call.arguments)) @call.site++; Member call on a variable named ``copy``, ``consume`` or ``unsafe``: the+; grammar reads ``copy.remove(at: i)`` as the ``copy`` operator applied to an+; implicit member call ``.remove(at: i)``, the same tree as ``copy .remove(at: i)``.+; Read as the member call, the common case. The second branch is the first hop+; of a chain (``copy.remove(at: i).foo()``); like ``x.remove(at: i).foo()``, only+; that hop is a call site.+(_+ ["copy" "consume" "unsafe"] @call.receiver+ [+ (call_expression+ (prefix_expression "." (simple_identifier) @call.target)+ (call_suffix (value_arguments "(") @call.arguments)) @call.site+ (call_expression+ (navigation_expression+ (call_expression+ (prefix_expression "." (simple_identifier) @call.target)+ (call_suffix (value_arguments "(") @call.arguments)) @call.site))+ ]+)diff --git a/packages/core/src/repowise/core/upgrade/version.py b/packages/core/src/repowise/core/upgrade/version.pyindex da3370faf..380a97b0e 100644--- a/packages/core/src/repowise/core/upgrade/version.py+++ b/packages/core/src/repowise/core/upgrade/version.py@@ -79,7 +79,8 @@ STORE_FORMAT_VERSION: int = 2#: types (``put#1(String)``, ``put#1(int)``), and a method in a Java enum#: constant's body sits under the constant (``Op::PLUS::apply``); the first#: update re-keys those symbols and graph nodes. A Swift ``extension`` is an-#: ``impl``, no longer a ``class``.+#: ``impl``, no longer a ``class``. Swift parses with tree-sitter-swift 0.7, so+#: a type body holding ``#if`` keeps its members.PARSER_SCHEMA_VERSION: int = 8#: state.json key holding the store format version that wrote the store.diff --git a/pyproject.toml b/pyproject.tomlindex 31a3282d1..451dd7974 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -46,7 +46,7 @@ dependencies = ["tree-sitter-kotlin>=1,<2","tree-sitter-ruby>=0.23,<1","tree-sitter-c-sharp>=0.23,<1",- "tree-sitter-swift>=0.0.1",+ "tree-sitter-swift>=0.7.4,<0.8","tree-sitter-scala>=0.23,<1","tree-sitter-php>=0.23,<1","tree-sitter-pascal>=0.11,<1",diff --git a/tests/unit/ingestion/parser/test_swift.py b/tests/unit/ingestion/parser/test_swift.pyindex 4a0c29e74..2167609ec 100644--- a/tests/unit/ingestion/parser/test_swift.py+++ b/tests/unit/ingestion/parser/test_swift.py@@ -82,3 +82,35 @@ class TestSwiftParser:fi = _make_file_info("swift_pkg/Use.swift", "swift")result = parser.parse_file(fi, src)assert {c.target_name for c in result.calls} == {"f", "h"}++ def test_member_call_on_keyword_named_variable(self, parser: ASTParser) -> None:+ # The grammar reads `copy.remove(at: 0)` as the `copy` operator on `.remove(...)`.+ # A chain keeps its first hop, as `x.remove(at: 0).foo(2)` does.+ src = (+ b"func use() {\n var copy = xs\n copy.remove(at: 0)\n unsafe.run(1)\n"+ b" consume.drain(2)\n copy.insert(3).foo(4)\n}\n"+ )+ fi = _make_file_info("swift_pkg/Use.swift", "swift")+ result = parser.parse_file(fi, src)+ assert sorted((c.receiver_name, c.target_name) for c in result.calls) == [+ ("consume", "drain"),+ ("copy", "insert"),+ ("copy", "remove"),+ ("unsafe", "run"),+ ]++ def test_copy_and_consume_operators_are_not_calls(self, parser: ASTParser) -> None:+ src = b"func use() {\n let y = copy x\n let z = consume x\n consume w.foo(1)\n}\n"+ fi = _make_file_info("swift_pkg/Use.swift", "swift")+ result = parser.parse_file(fi, src)+ assert [(c.receiver_name, c.target_name) for c in result.calls] == [("w", "foo")]++ def test_conditional_compilation_in_type_body(self, parser: ASTParser) -> None:+ src = (+ b"class Haptics {\n #if !os(visionOS)\n private let gen = Gen()\n #endif\n"+ b" func fire() {}\n}\n"+ )+ fi = _make_file_info("swift_pkg/Haptics.swift", "swift")+ result = parser.parse_file(fi, src)+ assert result.parse_errors == []+ assert "fire" in {s.name for s in result.symbols if s.parent_name == "Haptics"}diff --git a/uv.lock b/uv.lockindex d3bb6d50b..b15316e0d 100644--- a/uv.lock+++ b/uv.lock@@ -3228,7 +3228,7 @@ requires-dist = [{ name = "tree-sitter-rust", specifier = ">=0.23,<1" },{ name = "tree-sitter-scala", specifier = ">=0.23,<1" },{ name = "tree-sitter-svelte", specifier = ">=1,<2" },- { name = "tree-sitter-swift", specifier = ">=0.0.1" },+ { name = "tree-sitter-swift", specifier = ">=0.7.4,<0.8" },{ name = "tree-sitter-typescript", specifier = ">=0.23,<1" },{ name = "tree-sitter-vb-dotnet", specifier = ">=0.3,<1" },{ name = "types-networkx", marker = "extra == 'dev'", specifier = ">=3.3,<4" },@@ -4351,17 +4351,18 @@ wheels = [[[package]]name = "tree-sitter-swift"-version = "0.0.1"-source = { registry = "https://pypi.org/simple" }-sdist = { url = "https://files.pythonhosted.org/packages/37/f7/35337caea29e24bb2f55d0499db53bcb879ff0eb2011e1fa567d5edab4b7/tree_sitter_swift-0.0.1.tar.gz", hash = "sha256:d43b0baf413ba4b049f92eadc074805cb6403655c905d3af24f12fce1c9f561b", size = 914654, upload-time = "2025-06-30T05:49:24.642Z" }-wheels = [- { url = "https://files.pythonhosted.org/packages/f0/f2/2e24418b486303b3ce5c6f5eef8eaa9ca2800151c02bb91e8b1da1650601/tree_sitter_swift-0.0.1-cp38-abi3-macosx_10_9_x86_64.whl", hash = "sha256:45d8d61c3dc9b72ec721ed93e5920d24f87bd6350298bc7c4edc261066cda745", size = 326139, upload-time = "2025-06-30T05:49:16.878Z" },- { url = "https://files.pythonhosted.org/packages/87/e0/811e80c9f68d49dbec2131b98fe3ba61d3e8d22f175885a9dd272bf5873c/tree_sitter_swift-0.0.1-cp38-abi3-macosx_11_0_arm64.whl", hash = "sha256:c669e830cfeec55d326c79478e25465e1b61207fdb9d5459533fd5f735051d20", size = 347863, upload-time = "2025-06-30T05:49:18.26Z" },- { url = "https://files.pythonhosted.org/packages/6a/f0/6abf3a4524286d6f1397b60715be56f241cd5a3f62c842ad19513c7f3044/tree_sitter_swift-0.0.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3caac02783238e9c72349bc4a8db11be258666d5ae1856ac54c46ca6086ecfc9", size = 426609, upload-time = "2025-06-30T05:49:19.426Z" },- { url = "https://files.pythonhosted.org/packages/f7/0c/d77ed1d313c4b2360fd7ffa558be796875f400b7eb09efc3373700ffef34/tree_sitter_swift-0.0.1-cp38-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d009e46d9800cf5ca3c585163d04c70660d1383f350dad93d08bf00735d2714b", size = 376564, upload-time = "2025-06-30T05:49:20.623Z" },- { url = "https://files.pythonhosted.org/packages/46/06/fbe2d9f0de0df3e8515b54d88ef63deaad865d70a8789d80e2cdc87c7452/tree_sitter_swift-0.0.1-cp38-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:f61776dbf4bcb3fd9a852c69a3f61d08abaad4dd22272bf04272f7ed26aa6d75", size = 353064, upload-time = "2025-06-30T05:49:21.554Z" },- { url = "https://files.pythonhosted.org/packages/5e/b6/3b3a13d28e8ca2cd3a8c48fe2e94beb57314075f5a7881df0f1fc5e3d50e/tree_sitter_swift-0.0.1-cp38-abi3-win_amd64.whl", hash = "sha256:4ca542091e411b2236c862a38e1c1b34323c909f011c122c10747e6010e13693", size = 334094, upload-time = "2025-06-30T05:49:22.803Z" },- { url = "https://files.pythonhosted.org/packages/ee/d3/3dd83cc13e55282f25d44a19069dd31f19131e14b5619cd52a870151d4bb/tree_sitter_swift-0.0.1-cp38-abi3-win_arm64.whl", hash = "sha256:ce3add5c7156e2e5329e675e7ac6a3389cb1e9ebff18c9248538e54fc738390d", size = 329505, upload-time = "2025-06-30T05:49:23.714Z" },+version = "0.7.4"+source = { registry = "https://pypi.org/simple" }+sdist = { url = "https://files.pythonhosted.org/packages/f2/98/8265b5ee5f590654935742d89c187460deb867411307680e1ed7cb39979a/tree_sitter_swift-0.7.4.tar.gz", hash = "sha256:1676a8ee04442993b84c239291d5976b823d22d25b02cfc5161a1bd644b390f5", size = 1157132, upload-time = "2026-10-04T03:18:32.136Z" }+wheels = [+ { url = "https://files.pythonhosted.org/packages/5d/99/13ce6e8b5ed496fff03a8d04e34d7dd75f60166bea50c435da4a84ddb0f7/tree_sitter_swift-0.7.4-cp38-abi3-macosx_10_9_x86_64.whl", hash = "sha256:e76bc562815bbeb4a6504a9fac6699ffc2b779ef55e12ea863f6a3f8fa0dfee6", size = 388236, upload-time = "2026-10-04T03:18:22.182Z" },+ { url = "https://files.pythonhosted.org/packages/3d/94/ae2a4abb3f240b613635507e83893ad192bbc58074f811eeec65dba38ab6/tree_sitter_swift-0.7.4-cp38-abi3-macosx_11_0_arm64.whl", hash = "sha256:62ce592607fa532687a2d4656a90db2f04cbc197e34077038bca2e47073b6db7", size = 417091, upload-time = "2026-10-04T03:18:23.457Z" },+ { url = "https://files.pythonhosted.org/packages/9c/d1/05bcef72968411fefb7d6a0a2ccfb5bb3d248600949fe01fb80c6c3db57a/tree_sitter_swift-0.7.4-cp38-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:d11d15a479d7d3b14c7fc526b4daab107995feca5752936fec5c60cc7fa6fe4d", size = 425909, upload-time = "2026-10-04T03:18:24.497Z" },+ { url = "https://files.pythonhosted.org/packages/e8/11/b5a3c0a3bf1bdf64dbaa0ebd71c1cfeff22aa13899443674175c76fdb500/tree_sitter_swift-0.7.4-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f54606c229c32ba130fbb005cbfb99e50ccfa0023ab9d1ffd45850515c893a7b", size = 415602, upload-time = "2026-10-04T03:18:25.649Z" },+ { url = "https://files.pythonhosted.org/packages/26/0c/21964e32a543fbe4ac8dc6c138a2cd03f40aef9782c4c0b836dd058e08a8/tree_sitter_swift-0.7.4-cp38-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:6d66607643e65e059b57ffbfcbb8b68db168b1a8709449611cb92646825b86e5", size = 413874, upload-time = "2026-10-04T03:18:27.13Z" },+ { url = "https://files.pythonhosted.org/packages/ec/7f/6e21e938ad20bb6fd1f14723c99584e3663fd3182daf3666baec551f3cd2/tree_sitter_swift-0.7.4-cp38-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:32bfed7a3a41f6657a836684e47a876affd180e28ee0bd104fe67904be12e74c", size = 423822, upload-time = "2026-10-04T03:18:28.364Z" },+ { url = "https://files.pythonhosted.org/packages/22/9f/cdc6712032be81a590f275603936a325943424824fab6956bf7e3382f20a/tree_sitter_swift-0.7.4-cp38-abi3-win_amd64.whl", hash = "sha256:6edfdeff86d842e7ee54f2a5d77dad9b6d9cc8b9f1ae0342e1c4349c44348803", size = 396440, upload-time = "2026-10-04T03:18:29.464Z" },+ { url = "https://files.pythonhosted.org/packages/70/b0/7582b73528301e4aad3a5c786bf1d10622ec45f8d9676cf0c95c4a699b6e/tree_sitter_swift-0.7.4-cp38-abi3-win_arm64.whl", hash = "sha256:3d532f3f735e40c0cb84c101dcb43e04e25ab39e5bf6803ea2344a7e45b0cff3", size = 499988, upload-time = "2026-10-04T03:18:30.767Z" },][[package]]