Commit Graph

19 Commits

Author SHA1 Message Date
Matthew Bastien
5c3136694f use built-in LSP ResponseError with code RequestFailed for errors 2025-01-17 11:11:55 -05:00
Matthew Bastien
0a95899dd1 make position optional 2025-01-17 11:11:55 -05:00
Alex Hoppen
2e61d33645 Mark MessageDecodingError.MessageKind as @frozen 2024-10-02 09:34:49 -07:00
Alex Hoppen
0bb605d641 Remove a few workarounds that should no longer be needed 2024-08-07 10:00:04 -07:00
Alex Hoppen
191d366a2c Add a maximum duration for sourcekitd requests
VS Code does not cancel semantic tokens requests. If a source file gets into a state where an AST build takes very long, this can cause us to wait for the semantic tokens from sourcekitd for a few minutes, effectively blocking all other semantic functionality in that file.

To circumvent this problem (or any other problem where an editor might not be cancelling requests they are no longer interested in) add a maximum request duration for SourceKitD requests, defaulting to 2 minutes.

rdar://130948453
2024-07-02 22:47:27 +02:00
Alex Hoppen
fa54ef1748 Add Sendable annotations to LanguageServerProtocol 2024-03-03 21:50:38 -08:00
Alex Hoppen
8acc5bd999 Factor related identifiers request into a separate file
This allows use to re-use related identifiers when implementing rename
2023-12-09 08:34:40 -08:00
Max Desiatov
d5831963cd Fix typo in LanguageServerProtocol/Error.swift (#970) 2023-11-27 10:08:02 +05:30
Alex Hoppen
d0fc00ce98 Format using swift-format
Add `.swift-format` to the repo and format the repo with `swift-format`.

This commit does not add any automation to enforce formatting of sourcekit-lsp in CI. The goal of this commit is to get the majority of source changes out of the way so that the diff of actually enforcing formatting will have fewer changes or conflicts.
2023-10-10 13:44:47 -07:00
Alex Hoppen
ca45a7a62b Return a .serverCancelled error code if the server cancels a request
`.cancelled` should only be returned if the client requested cancellation.
2022-12-05 08:45:36 +01:00
Alex Hoppen
93a8f91436 Update request and notification definitions to LSP 3.17 2022-12-01 10:44:40 +01:00
Alex Hoppen
d917e40410 Prepare SourceKitServer for multiple workspaces
This makes SourceKitServer keep track of multiple workspaces and their handling. It does not include the functionality to determine which workspace a file belongs to.
2022-05-04 14:48:31 +02:00
Ben Langmuir
3927e639be Revert "Support opening multiple workspaces in a single sourcekit-lsp instance" 2022-05-03 13:47:19 -07:00
Alex Hoppen
6425b0d212 Prepare SourceKitServer for multiple workspaces
This makes SourceKitServer keep track of multiple workspaces and their handling. It does not include the functionality to determine which workspace a file belongs to.
2022-04-29 14:33:01 +02:00
Alex Hoppen
25cd302cad Remove dependency of LanguageServerProtocol on SKSupport
Apart from removing unnecessary imports, the following changes were
performed:
- Move CancellationToken from SKSupport to LanguageServerProtocol
- Move CustomCodable to its own module
  - CustomCodable belongs in LanguageServerProtocol but moving it there
    causes compilation to fail. As a workaround, move it to its own
    module
2019-11-13 12:02:14 -08:00
Marcin Krzyzanowski
fb2d4d14b8 Embrace Swift.Result in place SwiftPM.Basic.Result 2019-06-10 11:24:53 +02:00
Ben Langmuir
7a64c89ba6 [lsp] Remove dead initializer on MessageDecodingError 2018-12-12 19:45:18 -08:00
Ben Langmuir
4880184603 [gardening] Move synthesized conformances to primary declaration
The style I started with (putting each conformance on its own extension)
turned out to be pointlessly verbose in practice. It also separated the
protocol from the "implentation" in the sense that the property
declarations are what determine how the conformance works.
2018-12-07 17:38:52 -08:00
Ben Langmuir
aabf57a252 Import SourceKit-LSP sources 2018-11-13 15:50:48 -08:00