Hello Everyone,
I'm Lokesh.T.R from India. I'm a sophomore currently pursuing my bachelor's degree in Computer Science and Engineering in Vel Tech University, Chennai. I'm thrilled to share with you on what I have accomplished over the summer with my mentors @ahoppen and @adam-fowler for Google Summer of Code 2024.
Overview
Over the summer, we worked on adding support for expansion of Swift Macros in Visual Studio Code. Our project's main goal is to implement a code action in VS Code that allows users to view the generated contents of a Swift Macro.
Here's what it looks like to show the generated contents of a Swift Macro in a peeked editor when the "Expand Macro" Code Action is invoked by the user:
There were also some stretch goals which include:
- Bringing Semantic Functionality (such as jump-to-defintion, quick help on hover, Syntax Highlighting, etc.) to the macro expansion being previewed.
- Allowing to perform the "Expand Macro" Code Action on a macro that is present in the generated macro expansion to support the expansion of nested macros.
And as a bonus, we also worked on supporting macro expansions in other LSP-based editors which by default cannot make use of the LSP extensions that we introduced.
When can you start using this feature?
This will be available with SourceKit-LSP bundled with Swift 6.1 and the next VS Code Swift Extension Release.
For the curious minds, This feature is available in the main
branch of sourcekit-lsp
and vscode-swift
, right now.
Implementation Details
Please check out the full post in the SourceKit-LSP Category here:
Thanks & Gratitude
I offer my deepest gratitude to my mentors @ahoppen and @adam-fowler without whom this journey is impossible. GSoC is not only the work of me as a contributor but also the work of my mentors in guiding me and helping me out whenever possible.
If not for you two people, this project wouldn't be a success.