Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
9ba4920
Prepare 3rd blog post for summer of code summary posts (2025)
ktoso Nov 4, 2025
e91be3f
Merge branch 'main' into gsoc-2025-post-3-lsp-documentation
ktoso Nov 4, 2025
4932cee
Update _posts/2025-11-NN-swift-gsoc-2025-highlight-3-vscode-swift-lsp…
ktoso Nov 5, 2025
4dfba61
Update _posts/2025-11-NN-swift-gsoc-2025-highlight-3-vscode-swift-lsp…
ktoso Nov 5, 2025
6198c6b
Move post to Developer Tools category
ktoso Nov 5, 2025
b212f41
Apply suggestions from code review
ktoso Nov 5, 2025
a1d2dc6
Merge branch 'main' into gsoc-2025-post-3-lsp-documentation
ktoso Nov 6, 2025
dd65345
rename file and move the link to full version
ktoso Nov 6, 2025
88cf42e
Surround author with quotes
ktoso Nov 6, 2025
1dc4223
Update _posts/2025-11-12-swift-gsoc-2025-highlight-3-vscode-swift-lsp…
davelester Nov 10, 2025
2629cbe
Update _data/authors.yml
davelester Nov 10, 2025
199a105
Update 2025-11-12-swift-gsoc-2025-highlight-3-vscode-swift-lsp-docume…
ktoso Nov 11, 2025
524663c
Update 2025-11-12-swift-gsoc-2025-highlight-3-vscode-swift-lsp-docume…
ktoso Nov 11, 2025
749537e
Update 2025-11-12-swift-gsoc-2025-highlight-3-vscode-swift-lsp-docume…
ktoso Nov 11, 2025
96e71dd
Update 2025-11-12-swift-gsoc-2025-highlight-3-vscode-swift-lsp-docume…
ktoso Nov 11, 2025
8ca01b2
Update 2025-11-12-swift-gsoc-2025-highlight-3-vscode-swift-lsp-docume…
ktoso Nov 11, 2025
b3ecc39
Update 2025-11-12-swift-gsoc-2025-highlight-3-vscode-swift-lsp-docume…
ktoso Nov 11, 2025
7a4e3b6
Update 2025-11-12-swift-gsoc-2025-highlight-3-vscode-swift-lsp-docume…
ktoso Nov 11, 2025
db683f8
add instructions on how to try it out
ktoso Nov 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion _data/authors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,12 @@ mitchellallison:
github: mitchellallison
about: "Mitchell Allison works on Distributed Systems in Swift at Apple."

ahmedelrefaey:
name: Ahmed Elrefaey
email: a7med.mahmoud2004@gmail.com
github: a7medev
about: Ahmed is a Google Summer of Code 2025 contributor, where he worked on improving the display of Swift documentation during code completion in SourceKit-LSP and VS Code.

heckj:
name: Joe Heck
email: j_heck@apple.com
Expand All @@ -571,4 +577,4 @@ davelester:
name: Dave Lester
github: davelester
gravatar: "376decb8be2d1c50df06daf50ef3b6b5"
about: "Dave Lester is a Senior Product Manager at Apple and member of the Swift website workgroup."
about: "Dave Lester is a Senior Product Manager at Apple and member of the Swift website workgroup."
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
layout: new-layouts/post
published: true
date: 2025-02-NN 10:00:00
title: 'Swift GSoC 2025 highlight: Improve the display of documentation during code completion in SourceKit-LSP
author: [ktoso, ahmedelrefaey, hamish]
category: "Community"
---
Another year of successful Swift participation in [Google Summer of Code](https://summerofcode.withgoogle.com) 2025 came to an end recently, and this year we'd like to shine some light on the projects and work accomplished during the summer!

Summer of Code is an annual program, organized by Google, which provides hands-on experience for newcomers contributing
to open source projects. Participants usually are students, but do not have to be.

In this series of four posts, we'll highlight each of the Summer of Code contributors and their projects.

- [Bringing Swiftly support to VS Code](2025-11-NN-swift-gsoc-2025-highlight-1-vscode-swiftly.md)
- [JNI mode for swift-java’s source jextract tool](2025-11-NN-swift-gsoc-2025-highlight-2-swift-java-jextract-jni-mode.md)
- Improve the display of documentation during code completion in SourceKit-LSP (this post)
- [Improved Console Output for Swift Testing](2025-11-NN-swift-gsoc-2025-highlight-4-swift-testing-output.md)

---

## Improve the display of documentation during code completion in SourceKit-LSP

Hi everyone!

This is Ahmed Elrefaey. I’m excited to share with you an update on my GSoC project, Improve the display of documentation during code completion in SourceKit-LSP, mentored by Hamish Knight.

### Project Goals

The aim of this project is to enhance how documentation is displayed in SourceKit-LSP during code completion by:

1. Showing the full documentation for a code completion item instead of the first paragraph only, which we call “brief documentation”.
2. Implementing Language Server Protocol’s [signature help](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_signatureHelp) request showing the user which overloads are available, along with their corresponding documentation.

### Progress

During this summer, we have made great progress on this project that I want to share with you.

We have successfully implemented full documentation comment retrieval for completion items by lazily retrieving the full documentation comment upon request to avoid having to fetch all documentation comments at once.

Here’s what SourceKit-LSP currently provides in VS Code (brief documentation):

![Brief documentation demo in VS Code.|690x412](/assets/images/gsoc-25/brief.gif)

And here’s how it looks with full documentation:

![Full documentation demo in VS Code.|690x412](/assets/images/gsoc-25/full.gif)

We have also implemented a large portion of signature help support, showing the available overloads and their corresponding documentation while editing.
We reused the existing argument completion logic to determine the overloads and refactored the code completion item description implementation to reuse it in signature help.

Here’s a quick demo of signature help in VS Code.

![Signature help demo in VS Code|690x441](/assets/images/gsoc-25/output.gif)

### Closing Thoughts

I'm incredibly grateful for this opportunity to contribute to the Swift project, and I really learned a lot from this experience. I'd like to thank my mentor, Hamish Knight, for his unwavering support and guidance throughout this summer. I’d also like to thank Alex Hoppen, Rintaro Ishizaki, and Ben Barham for their valuable feedback during code review.

---

If you'd like to learn more about this project, please [check out the full post on the Swift forums](https://forums.swift.org/t/gsoc-2025-improve-the-display-of-documentation-during-code-completion-in-sourcekit-lsp/81976)!
Binary file added assets/images/gsoc-25/brief.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/gsoc-25/full.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/gsoc-25/output.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.