feat: add Swift tree-sitter support#18
Merged
Merged
Conversation
…iblings Wire tree-sitter-swift grammar into outline_language(), add Swift-specific query patterns for callee extraction and sibling resolution. Swift grammar notes: - class_declaration covers class/struct/enum/extension/actor via declaration_kind field (all show as "class" in outline) - Call expressions have no named fields — function name is either a direct simple_identifier child or inside navigation_expression - protocol_declaration, init_declaration, deinit_declaration, typealias_declaration added to outline walker Closes #16 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add protocol_function_declaration to Function match arm - Add protocol_property_declaration to property match arm - Return "deinit" name for deinit_declaration (has no name field) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tree-sitter-swiftgrammar for full AST-aware code intelligence on.swiftfilescall_expression(direct calls and member access vianavigation_expression)self.references viaself_expression+navigation_suffixprotocol_function_declaration,protocol_property_declaration,deinit_declaration(no name field)Closes #16
Changes
Cargo.tomltree-sitter-swift = "0.7", bump to 0.4.7npm/package.jsonsrc/read/outline/code.rssrc/search/callees.rssrc/search/siblings.rsTest plan
cargo check— compiles cleancargo clippy— zero warningscargo test— all 58 tests pass🤖 Generated with Claude Code