Skip to content

Conversation

@a7medev
Copy link
Member

@a7medev a7medev commented Jul 28, 2025

Note

This PR depends on #83646, it should be its base PR but GitHub doesn't allow that.
Commits after 6ebbb12 are part of this PR.

Add a basic signaturehelp request to SourceKit that:

  1. Extracts and returns signature label.
  2. Extracts offset and length of each parameter in the signature label.
  3. Returns full documentation for signature (in a future PR, full documentation should be split into signature documentation and parameter documentation).

@a7medev a7medev marked this pull request as draft July 28, 2025 21:26
@a7medev a7medev force-pushed the feat/signature-help-basic branch 4 times, most recently from 7c436a1 to 254f4e4 Compare August 11, 2025 22:11
@a7medev a7medev changed the title [IDE] Add basic signature help request to SourceKit [IDE] [Signature Help] Add basic signature help request to SourceKit Aug 11, 2025
@a7medev a7medev marked this pull request as ready for review August 11, 2025 22:33
@a7medev a7medev force-pushed the feat/signature-help-basic branch 4 times, most recently from 8543c6d to 21977fc Compare August 22, 2025 15:52
@a7medev a7medev force-pushed the feat/signature-help-basic branch from 10cb4af to aea823a Compare August 26, 2025 21:44
@a7medev a7medev force-pushed the feat/signature-help-basic branch from aea823a to 6b8b3c4 Compare August 28, 2025 16:39
@a7medev a7medev requested a review from hamishknight August 28, 2025 16:39
@a7medev
Copy link
Member Author

a7medev commented Aug 28, 2025

@hamishknight I've addressed your comments (half-addressed this one: #83378 (comment)), can you please recheck? 🙏🏼

@hamishknight
Copy link
Contributor

@a7medev Can you rebase this PR to make it a bit easier to re-review now that the other PRs have landed?

@a7medev a7medev force-pushed the feat/signature-help-basic branch from 6b8b3c4 to aabab5b Compare September 1, 2025 11:39
@a7medev
Copy link
Member Author

a7medev commented Sep 1, 2025

@hamishknight Updated. ✅

Copy link
Contributor

@hamishknight hamishknight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! LGTM

@a7medev
Copy link
Member Author

a7medev commented Sep 3, 2025

@hamishknight Can you please trigger CI? 🙏🏼

@hamishknight
Copy link
Contributor

@swift-ci please smoke test

@hamishknight
Copy link
Contributor

@a7medev Looks like a couple of test failures on Windows:

# | Unsupported: 'diff': option -B not recognized

Do we really need to pass -B?

@a7medev
Copy link
Member Author

a7medev commented Sep 3, 2025

@hamishknight Fixed. I was mainly using it to prevent matching the extra newline at the end of the expected output but it wasn't necessary.

@hamishknight
Copy link
Contributor

Thanks!

@hamishknight
Copy link
Contributor

@swift-ci please smoke test

Copy link
Member

@rintaro rintaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with merging this as-is.

But my preference is that tools/SourceKit should only be a facade of lib/IDE.
I.e. all the logic should be in IDE and the primary test should be swift-ide-test.
sourcekitd-test is for testing SourceKit request/response handling/formatting only.

@a7medev
Copy link
Member Author

a7medev commented Sep 3, 2025

@rintaro I agree and we've considered this but we descoped it for now to focus on getting the feature done first. I plan on moving this to lib/IDE if I had time to work on it either during GSoC or after it.

@rintaro
Copy link
Member

rintaro commented Sep 3, 2025

Sounds good to me. Thanks for working on this!

@hamishknight hamishknight merged commit 9d1436c into swiftlang:main Sep 4, 2025
3 checks passed
hamishknight pushed a commit to swiftlang/sourcekit-lsp that referenced this pull request Sep 5, 2025
Depends on swiftlang/swift#83378

---

Adds support for the LSP signature help request.

> [!NOTE]
> As of swiftlang/swift#83378, SourceKitD still
doesn't separate parameter documentation from the signature
documentation and thus parameters don't have their own separate
documentation. This should just work once SourceKitD implements this
functionality and we'll only need to modify the tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants