Skip to content

Prefix LSP/BSP extension methods with sourcekit/ - #2632

Merged
rintaro merged 2 commits into
swiftlang:mainfrom
rintaro:message-sourcekit-prefix
Jun 23, 2026
Merged

Prefix LSP/BSP extension methods with sourcekit/#2632
rintaro merged 2 commits into
swiftlang:mainfrom
rintaro:message-sourcekit-prefix

Conversation

@rintaro

@rintaro rintaro commented Apr 29, 2026

Copy link
Copy Markdown
Member

Rename all SourceKit-LSP–specific LSP and BSP extension requests and notifications to use the sourcekit/ prefix (e.g. workspace/testssourcekit/workspace/tests).

  • Register the legacy name alias in MessageRegistry so incoming messages from existing clients are still dispatched correctly.
  • Advertise both the new and legacy method names in the experimental capability dict so old clients can still discover the capabilities they know.
  • Accept legacy names advertised by old clients in CapabilityRegistry.
  • Use LegacyNameFallbackConnection to retry requests with the legacy method name when the peer returns methodNotFound for a sourcekit/-prefixed request. Used in:
    • SourceKitLSPServer.client (server→client) to keep old editors working
    • ExternalBuildServerAdapter.connectionToBuildServer (SourceKit-LSP→BSP) to keep old build servers working

see: swiftlang/swift-tools-protocols#48

Fixes #2631

@rintaro

rintaro commented Apr 30, 2026

Copy link
Copy Markdown
Member Author

swiftlang/swift-tools-protocols#48
@swift-ci Please test Windows

@rintaro

rintaro commented Apr 30, 2026

Copy link
Copy Markdown
Member Author

swiftlang/swift-tools-protocols#48
@swift-ci Please test

@rintaro

rintaro commented May 1, 2026

Copy link
Copy Markdown
Member Author

swiftlang/swift-tools-protocols#48
@swift-ci Please test Windows

@rintaro
rintaro marked this pull request as ready for review May 1, 2026 16:21
@rintaro

rintaro commented May 7, 2026

Copy link
Copy Markdown
Member Author

Added a commit to start advertising "experimental" in build/initialize message.

@rintaro

rintaro commented May 7, 2026

Copy link
Copy Markdown
Member Author

swiftlang/swift-tools-protocols#48
@swift-ci Please test Windows

@rintaro

rintaro commented May 8, 2026

Copy link
Copy Markdown
Member Author

swiftlang/swift-tools-protocols#48
@swift-ci Please test

@rintaro
rintaro force-pushed the message-sourcekit-prefix branch 2 times, most recently from a522361 to 4a07f9e Compare May 13, 2026 22:51
@rintaro

rintaro commented May 13, 2026

Copy link
Copy Markdown
Member Author

swiftlang/swift-tools-protocols#48
@swift-ci Please test

@rintaro

rintaro commented May 13, 2026

Copy link
Copy Markdown
Member Author

swiftlang/swift-tools-protocols#48
@swift-ci Please test Windows

@rintaro

rintaro commented May 14, 2026

Copy link
Copy Markdown
Member Author

swiftlang/swift-tools-protocols#48
@swift-ci Please test

1 similar comment
@rintaro

rintaro commented May 19, 2026

Copy link
Copy Markdown
Member Author

swiftlang/swift-tools-protocols#48
@swift-ci Please test

rintaro added 2 commits June 22, 2026 11:16
Rename all SourceKit-LSP–specific LSP and BSP extension requests and
notifications to use the `sourcekit/` prefix (e.g. `workspace/tests`
→ `sourcekit/workspace/tests`).

* Register the legacy name alias in `MessageRegistry` so incoming
  messages from existing clients are still dispatched correctly.
* Advertise both the new and legacy method names in the `experimental`
  capability dict so old clients can still discover the capabilities
  they know.
* Accept legacy names advertised by old clients in `CapabilityRegistry`.
* Use `LegacyNameFallbackConnection` to retry requests with the legacy
  method name when the peer returns `methodNotFound` for a
  `sourcekit/`-prefixed request. Used in:
  * `SourceKitLSPServer.client` (server→client) to keep old editors working
  * `ExternalBuildServerAdapter.connectionToBuildServer` (SourceKit-LSP→BSP)
    to keep old build servers working
Lets BSP servers know which SourceKit extension methods SourceKit-LSP
supports, so they can choose between the current sourcekit/-prefixed
names and the legacy names.
@rintaro
rintaro force-pushed the message-sourcekit-prefix branch from 4a07f9e to 25a8eb7 Compare June 22, 2026 18:16
@rintaro

rintaro commented Jun 22, 2026

Copy link
Copy Markdown
Member Author

swiftlang/swift-tools-protocols#48
@swift-ci Please test

1 similar comment
@rintaro

rintaro commented Jun 22, 2026

Copy link
Copy Markdown
Member Author

swiftlang/swift-tools-protocols#48
@swift-ci Please test

@rintaro
rintaro merged commit 216609f into swiftlang:main Jun 23, 2026
3 checks passed
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.

Rename all experimental notifications/requests to have a sourcekit/ prefix

2 participants