GSoC-2021 : Show Swift inferred types in VSCode using SourceKit-LSP

Hi @ahoppen,

My name is Sparsh Singh, a 3rd year engineering student in Information Technology & Mathematical Innovations from University of Delhi.

I find the project you have proposed for this year GSoC interesting, I have recently started working on swift and though I don't have much experience in contributing to any open source platform. I am hoping to learn something from this experience irrespective of the outcome. I hope you could share some resources or guide me in the right direction so I could get a gist of the problem presented here.

Thanks in advance.

3 Likes

Hi @ishusingh, thanks for the interest!
For organizational purposes, could I ask you to add the ‘gsoc2021’ tag to your post? Thank you!

1 Like

Hi Sparsh,

Thanks for your interest in participating in GSoC and this proposal in particular.

To get an idea for how the feature should be looking, I suggest you intall rust-analyzer and open a Rust project (e.g. sccache). As you browse through the source code, you should see type annotations. rust-analyzer also has some good documentation on how they implemented the type hints in their LSP proposal.

If you also install SourceKit-LSP, and open a Swift file in VSCode, you’ll notice that the type information is already there and is displayed as you hover over a variable. This is handled by SourceKit-LSP here, so we’d need to implement the rust-analyzer feature in terms of the information returned by the cursor info in SourceKit-LSP.

Does this help you understand what the proposal is about? If not, don’t hesitate to ask.

Also, all of what I have described above is just an idea for a GSoC project from my side. If you’ve got your own ideas on what would be cool to have implemented in Swift (or how to implement the projects proposed by use), we encourage you to present your own thoughts.

– Alex

2 Likes