Commit Graph

12 Commits

Author SHA1 Message Date
Alex Hoppen
7e7df04b48 Make the SourceKitLSP module build in Swift 6 mode
Swift 6 mode didn’t find any notable data races. But it’s good to know Swift 6 will prevent future ones.
2024-05-13 21:28:42 -07:00
Max Desiatov
747c39b3b6 Remove unused import Dispatch from Message.swift (#1156)
This import is unused and is redundant in that file
2024-03-31 09:04:39 -07:00
Alex Hoppen
7c46df3abe Remove clientID from request handling
The client ID was needed when a `MessageHandler` could handle messages from multiple connections. We don’t support this anymore (because it wasn’t needed) and so the client ID doesn’t need to get passed through as well.
2024-03-20 08:28:26 +01:00
Alex Hoppen
fa54ef1748 Add Sendable annotations to LanguageServerProtocol 2024-03-03 21:50:38 -08:00
Alex Hoppen
b22af35eb1 Revert asyncificaiton changes
The asyncification changes caused some non-deterministic test failures. I believe that some of these are due to race conditions that are the result of the partial transition to actors.

Instead of merging the asyncification piece by piece, I will collect the changes asyncification changes in a branch and then qualify that branch througougly (running CI multiple times) before merging it into `main`.
2023-09-30 10:09:59 -07:00
Alex Hoppen
0e5d5c9fda Make MessageHandler.handle async
This is the prerequisite for making `SourceKitServer` an actor, which will mean that the `handle` methods will be `async`.

The current paradigm of returning from `handle` once we can guarantee that there’s no out-of-order execution and then returning the actual result via the callback that’s attached to `Request` is a little weird still. I am hoping to change this paradigm to return the actual result and have a callback function that `handle` can call to indicate that it’s ready to accept another message while guaranteeing in-order execution, essentially flipping the role of the return value and the closure callback. But that’s something to be done after the entire stack has been asyncificied.
2023-09-27 09:47:51 -07:00
David Goldman
cf19900d84 Swap BuildSystem to remove build settings method (#183)
Remove `settings(for:)` from the BuildSystem API in favor of the change callback

- With the `settings(for:)` method removed, we instead block on a
  callback from the `BuildSystemManager` which itself handles
  the primary build system callback in conjunction with the fallback
  system

- We queue up notifications / requests that reference documents
  until we receive the callback.

- Remove language from FileBuildSettings as it is no longer needed,
  Swift-specific working dir fixes are now in SwiftCompileCommand

- registerForChangeNotifications should inform its delegate
  asynchronously instead of immediately
2020-06-01 13:20:15 -04:00
Alex Hoppen
4b3c571db6 Eliminate _IndirectConnection and replace it by closure
This allows us to move the semaphore logic out of the message to the connection where it belongs.
2019-11-12 15:04:44 -08:00
Ben Langmuir
e6fc0f017b [cli] Add --sync option for testing
When testing the sourcekit-lsp binary, it is handy to be able to force
requests to be handled synchronously. This only affects the protocol
layer, not the implementation. This option is hidden from the help text
and should only be used for testing/debugging.
2019-08-22 16:19:36 -07:00
Ben Langmuir
51be8a9abb [gardening] Cleanup comments in Message(s).swift 2018-12-07 22:50:24 -08:00
Ben Langmuir
4e524d595b [lsp] Document the initialize request and split into its own file 2018-12-07 22:48:14 -08:00
Ben Langmuir
aabf57a252 Import SourceKit-LSP sources 2018-11-13 15:50:48 -08:00