Skip to content

Prefix LSP/BSP extension methods with sourcekit/#2632

Open
rintaro wants to merge 2 commits into
swiftlang:mainfrom
rintaro:message-sourcekit-prefix
Open

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

Conversation

@rintaro
Copy link
Copy Markdown
Member

@rintaro rintaro commented Apr 29, 2026

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
Copy link
Copy Markdown
Member Author

rintaro commented Apr 30, 2026

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

@rintaro
Copy link
Copy Markdown
Member Author

rintaro commented Apr 30, 2026

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

@rintaro
Copy link
Copy Markdown
Member Author

rintaro commented May 1, 2026

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
Copy link
Copy Markdown
Member Author

rintaro commented May 7, 2026

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

@rintaro
Copy link
Copy Markdown
Member Author

rintaro commented May 7, 2026

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

@rintaro
Copy link
Copy Markdown
Member Author

rintaro commented May 8, 2026

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

@rintaro rintaro force-pushed the message-sourcekit-prefix branch from e426ef7 to a522361 Compare May 13, 2026 05:28
rintaro added 2 commits May 13, 2026 15:51
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 a522361 to 4a07f9e Compare May 13, 2026 22:51
@rintaro
Copy link
Copy Markdown
Member Author

rintaro commented May 13, 2026

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

@rintaro
Copy link
Copy Markdown
Member Author

rintaro commented May 13, 2026

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

@rintaro
Copy link
Copy Markdown
Member Author

rintaro commented May 14, 2026

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

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