Commit Graph

14 Commits

Author SHA1 Message Date
Rintaro Ishizaki 04118be02d Prefix SourceKit-LSP extension methods with sourcekit/
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
2026-06-22 11:16:37 -07:00
Rintaro Ishizaki b9e4c67793 Delete SwiftExtensions duplicates of swift-tools-protocols APIs
Delete `Collection+Only.swift`, `Duration+Seconds.swift`,
`FileManagerExtensions.swift`, `PipeAsStringHandler.swift`, and
`URLExtensions.swift` from `Sources/SwiftExtensions/`. The same
APIs now live in swift-tools-protocols as `@_spi(SourceKitLSP)
public` declarations.

Update each call site to add `@_spi(SourceKitLSP) import
ToolsProtocolsSwiftExtensions` next to the existing
`import SwiftExtensions`. Add the
`_ToolsProtocolsSwiftExtensionsForPlugin` dependency and the
`ToolsProtocolsSwiftExtensions=_ToolsProtocolsSwiftExtensionsForPlugin`
module alias to the `SwiftSourceKitClientPlugin` target in both
`Package.swift` and the corresponding `CMakeLists.txt`.
2026-06-08 21:08:24 -07:00
Alex Hoppen 92a2830a28 Mark Connection.send as @_disfavoredOverload
Otherwise `Connection.send` is ambiguous once we pick up https://github.com/swiftlang/swift-tools-protocols/pull/28
2026-01-03 20:08:39 +01:00
Owen Voorhees f04b971726 Adopt swift-tools-protocols 2025-10-31 14:11:11 -07:00
Alex Hoppen 98cd30bb1c Apply exhaustive swift-format configuration from swift-syntax
Apply the exhaustive swift-format configuration from https://github.com/swiftlang/swift-syntax/pull/3117 to sourcekit-lsp. Also apply all automatic formattings.
2025-08-11 09:23:39 +02:00
Alex Hoppen c6e1e9286a Log request durations from LocalConnection 2025-03-21 16:50:35 -07:00
Alex Hoppen 1cfa8db1d8 Require Swift 6 to build SourceKit-LSP
This significantly cleans up our `import` statements
2025-03-07 08:05:49 -08:00
Alex Hoppen 5c60d1d39c Add a new test project type that uses a custom build server
This allows us to more easily test behavior for build servers that have different behavior than SwiftPM and compile commands without having to implement the build server in Python.
2025-03-05 23:54:32 -08:00
Alex Hoppen 6818cbe45a Log a few strings publicly
Just something I noticed while reading logs
2025-03-03 13:29:29 -08:00
Alex Hoppen db792c536f Add a send method to InProcessSourceKitLSPClient and Connection in which the client specifies the request ID 2025-02-26 08:41:30 -08:00
Ben Barham ab12429651 Update the compiler arguments used for background AST builds
This fixes two issues:
1. The SwiftPM build system was setup without passing through whether it
   should prepare or not. This meant that we lost eg. the argument to
   allow compiler errors when building the AST (even though it was set
   when building the modules)
2. The compiler argument adjustment to remove harmful and unnecessary
   flags only applied to indexing arguments, not those passed to the AST
   builds

Resolves rdar://141508656.
2025-02-07 11:57:30 -08:00
Alex Hoppen 63fa05091d Log the request methods when logging a request's reply
This should make it easier to find a request response when searching for the response method.
2025-01-21 11:51:52 -08:00
Alex Hoppen 7b43383260 Emit a log message when we receive a cancel request notification 2025-01-02 14:17:23 +01:00
Alex Hoppen 8c2def8ef9 Rename SKSupport to LanguageServerProtocolExtensions 2024-11-13 16:53:58 -08:00