feat(ast): add Swift symbol parser#1
Open
ckorhonen wants to merge 1 commit into
Open
Conversation
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
Adds first-class Swift symbol extraction to CodeWiki’s AST parser registry. Swift files were already detected as source files, but there was no registered parser, so Swift/iOS repositories were effectively limited to file-level context. This adds a lightweight dependency-free parser that extracts common Swift declarations, imports, enum cases, properties, and coarse call/reference names.
Purpose
Make CodeWiki materially useful on Swift/iOS repositories without requiring SourceKit or adding a native tree-sitter Swift dependency.
Key Changes
SwiftAstParserfor best-effort Swift symbol indexing.swiftin the supported language registry assertion.Test / Lint Results
.venv/bin/python -m pytest tests/backend/test_ast_parser.py -q— 17 passedmake test— 194 passed, 3 skipped, 1 warningmake lint— backend Ruff and frontend ESLint passedmake typecheck— mypy passed with no issuesmake build— frontend production build passed; Vite reported the existing large chunk warningLinked Issues
None.
Screenshots / GIFs
N/A — backend parser/indexing change only; no UI changes.
Risk Assessment
Medium-low. This parser is intentionally heuristic and marked as
swift_regexmetadata rather than compiler-grade Swift analysis. It improves Swift repositories from file-only indexing to useful symbol-level context, but complex overload resolution, generated code, dynamic dispatch, and advanced Swift syntax should still be treated as best effort.