-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: remove Swift from fallback chunking extensions #7325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Based on PR #7309 discussion and validation from @adamhill, Swift parser is stable and functional. The assumption about parser instability was incorrect. Changes: - Removed Swift from fallbackExtensions list in supported-extensions.ts - Updated tests to expect Swift to use proper parser instead of fallback - Added comprehensive documentation of lessons learned in docs/lessons-learned/ This ensures Swift files use the proper tree-sitter parser for code indexing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewing my own code because apparently I trust no one, not even myself.
| ".vb", // Visual Basic .NET - no dedicated WASM parser | ||
| ".scala", // Scala - uses fallback chunking instead of Lua query workaround | ||
| ".swift", // Swift - uses fallback chunking due to parser instability | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add a brief comment here explaining why Swift was removed? Something like:
This would help future maintainers understand the history without needing to dig through PRs.
| @@ -0,0 +1,125 @@ | |||
| # Lessons Learned: Swift Parser Investigation | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an excellent lessons learned document! For a document of this length, would it be helpful to add a table of contents at the top? It would make navigation easier for future readers looking for specific sections.
|
I'll investigate the issue a bit more, this change prevented crashes for some people, I think we need to investigate a bit more before removing this fallback |
Summary
This PR removes Swift from the fallback chunking extensions list based on the learnings from PR #7309.
Context
In PR #7309, an incorrect assumption was made that the Swift tree-sitter parser was unstable and causing VS Code crashes. This led to adding Swift to the fallback chunking list. However, as @adamhill correctly pointed out, the Swift parser is stable and functional - developers work with Swift projects in VS Code daily without issues.
Changes
fallbackExtensionslist insrc/services/code-index/shared/supported-extensions.tsdocs/lessons-learned/swift-parser-investigation.mdLessons Learned
This change embodies the key lessons from the Swift parser investigation:
Testing
Related Issues
Important
Removes Swift from fallback chunking list to use tree-sitter parser, updates tests, and adds documentation on lessons learned.
fallbackExtensionsinsupported-extensions.tsto use tree-sitter parser.parser.vb.spec.tstests to reflect Swift's proper parser usage.swift-parser-investigation.mddocumenting lessons learned from the Swift parser investigation.This description was created by
for 3f22cc9. You can customize this summary. It will automatically update as commits are pushed.