[GSoC-2024] Proposal for "Code Completion for Keywords using swift-syntax"

Hey, swift community!

I'm Vivek, a junior year Computer Science and Engineering student at RGIPT, with three months of Swift development experience, including the creation of small-scale apps. My fascination with compilers and parsers has led me to SwiftSyntax and the prospect of improving code completion in Swift.

Project Overview:

This project aims to enhance code completion in Swift by leveraging swift-syntax. By analyzing Swift's grammar rules, we'll identify valid completions and implement algorithms to filter out irrelevant suggestions. Integration with SourceKit or SourceKit-LSP will ensure seamless transmission of results to Xcode.

Approach:

  1. Familiarize with SwiftSyntax to understand parsing and traversal capabilities.
  2. Analyze Swift's grammar rules to identify valid completions.
  3. Implement algorithms for contextual filtering to refine completion suggestions.
  4. Integrate completion engine with SourceKit or SourceKit-LSP for Xcode compatibility.

Expected Outcomes:

Comprehensive keyword and punctuator completions within the Swift syntax tree, minimizing manual maintenance and ensuring accuracy.

Timeline:

This is the general project flow I've come up after some reasearch:

  1. Weeks 1-2: Learn SwiftSyntax intricacies.
  2. Weeks 3-4: Analyze Swift's grammar rules.
  3. Weeks 5-6: Implement filtering algorithms.
  4. Weeks 7-8: Integrate with SourceKit/SourceKit-LSP.
  5. Weeks 9-10: Test, debug, and document.
  6. Weeks 11-12: Finalize project and documentation.

Conclusion:

This project offers a technical solution to enhance code completion in Swift, providing developers with a more efficient coding experience. I'm excited to contribute to this project and improve the Swift development ecosystem.

Thank you for considering my proposal! :heart:

Warm regards,
Vivek

1 Like

Hey @ahoppen can I get some directions on how to get a head start at this project? What should i read up and experiment with to make my prototype? I'm pretty new to this, so some tips would be great!

Hey @Odysseus,

Great to hear that you鈥檙e interested. I wrote a post about how to get started for GSoC last year that, I think, applies pretty well for this project as well. Implementing Incremental Re-Parsing in SwiftParser, GSoC 2023 - #2 by ahoppen . Let me know if you鈥檝e got any concrete questions.

1 Like

Thanks! I'll be sure to check it out.

1 Like