-
Notifications
You must be signed in to change notification settings - Fork 255
[GSoC-2025] Blog post 3: Improve the display of documentation during code completion in SourceKit-LSP #1212
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
Open
ktoso
wants to merge
19
commits into
swiftlang:main
Choose a base branch
from
ktoso:gsoc-2025-post-3-lsp-documentation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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 e91be3f
Merge branch 'main' into gsoc-2025-post-3-lsp-documentation
ktoso 4932cee
Update _posts/2025-11-NN-swift-gsoc-2025-highlight-3-vscode-swift-lsp…
ktoso 4dfba61
Update _posts/2025-11-NN-swift-gsoc-2025-highlight-3-vscode-swift-lsp…
ktoso 6198c6b
Move post to Developer Tools category
ktoso b212f41
Apply suggestions from code review
ktoso a1d2dc6
Merge branch 'main' into gsoc-2025-post-3-lsp-documentation
ktoso dd65345
rename file and move the link to full version
ktoso 88cf42e
Surround author with quotes
ktoso 1dc4223
Update _posts/2025-11-12-swift-gsoc-2025-highlight-3-vscode-swift-lsp…
davelester 2629cbe
Update _data/authors.yml
davelester 199a105
Update 2025-11-12-swift-gsoc-2025-highlight-3-vscode-swift-lsp-docume…
ktoso 524663c
Update 2025-11-12-swift-gsoc-2025-highlight-3-vscode-swift-lsp-docume…
ktoso 749537e
Update 2025-11-12-swift-gsoc-2025-highlight-3-vscode-swift-lsp-docume…
ktoso 96e71dd
Update 2025-11-12-swift-gsoc-2025-highlight-3-vscode-swift-lsp-docume…
ktoso 8ca01b2
Update 2025-11-12-swift-gsoc-2025-highlight-3-vscode-swift-lsp-docume…
ktoso b3ecc39
Update 2025-11-12-swift-gsoc-2025-highlight-3-vscode-swift-lsp-docume…
ktoso 7a4e3b6
Update 2025-11-12-swift-gsoc-2025-highlight-3-vscode-swift-lsp-docume…
ktoso db683f8
add instructions on how to try it out
ktoso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
_posts/2025-11-NN-swift-gsoc-2025-highlight-3-vscode-swift-lsp-documentation.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
ktoso marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| author: [ktoso, ahmedelrefaey, hamish] | ||
| category: "Community" | ||
ktoso marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --- | ||
| 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): | ||
|
|
||
|  | ||
|
|
||
| And here’s how it looks with full documentation: | ||
|
|
||
|  | ||
|
|
||
| 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. | ||
|
|
||
|  | ||
|
|
||
| ### 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)! | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.