You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** Whether the build server supports the `buildTarget/prepare` request */
29
29
prepareProvider?:bool;
30
30
31
-
/** Whether the server implements the `textDocument/sourceKitOptions` request. */
31
+
/** Whether the server implements the `sourcekit/textDocument/sourceKitOptions` request. */
32
32
sourceKitOptionsProvider?:bool;
33
33
34
34
/** The files to watch for changes.
@@ -91,18 +91,21 @@ If `data` contains a string value for the `workDoneProgressTitle` key, then the
91
91
92
92
`changes` can be `null` to indicate that all targets have changed.
93
93
94
-
## `buildTarget/prepare`
94
+
## `sourcekit/buildTarget/prepare`
95
95
96
96
The prepare build target request is sent from the client to the server to prepare the given list of build targets for editor functionality.
97
97
98
98
To do so, the build server should perform any work that is necessary to typecheck the files in the given target. This includes, but is not limited to: Building Swift modules for all dependencies and running code generation scripts. Compared to a full build, the build server may skip actions that are not necessary for type checking, such as object file generation but the exact steps necessary are dependent on the build system. SwiftPM implements this step using the `swift build --experimental-prepare-for-indexing` command.
99
99
100
100
The server communicates during the initialize handshake whether this method is supported or not by setting `prepareProvider: true` in `SourceKitInitializeBuildResponseData`.
101
101
102
-
- method: `buildTarget/prepare`
102
+
- method: `sourcekit/buildTarget/prepare`
103
103
- params: `PrepareParams`
104
104
- result: `void`
105
105
106
+
> [!NOTE]
107
+
> This request was previously named `buildTarget/prepare`. The old name is still accepted for backward compatibility.
The `TextDocumentSourceKitOptionsRequest` request is sent from the client to the server to query for the list of compiler options necessary to compile this file in the given target.
162
165
163
166
The build settings are considered up-to-date and can be cached by SourceKit-LSP until a `buildTarget/didChange` is sent for the requested target.
164
167
165
168
The request may return `nil` if it doesn't have any build settings for this file in the given target.
> This request was previously named `textDocument/sourceKitOptions`. The old name is still accepted for backward compatibility.
176
+
177
+
Also note that the `data` field in `TextDocumentSourceKitOptionsResult` is exposed to LSP clients via `sourcekit/workspace/sourceKitOptions` (previously `workspace/_sourceKitOptions`).
Request from the client to the server querying whether SourceKit-LSP is currently performing an background indexing tasks, including target preparation.
374
380
381
+
> [!NOTE]
382
+
> This request was previously named `sourceKit/_isIndexing`. The old name is still accepted for backward compatibility.
383
+
375
384
> [!IMPORTANT]
376
385
> This request is experimental and may be modified or removed in future versions of SourceKit-LSP without notice. Do not rely on it.
Request from the client to the server to wait for SourceKit-LSP to handle all ongoing requests and, optionally, wait for background activity to finish.
801
831
832
+
> [!NOTE]
833
+
> This request was previously named `workspace/synchronize`. The old name is still accepted for backward compatibility.
834
+
802
835
This method is intended to be used in automated environments which need to wait for background activity to finish before executing requests that rely on that background activity to finish. Examples of such cases are:
803
836
- Automated tests that need to wait for background indexing to finish and then checking the result of request results
804
837
- Automated tests that need to wait for requests like file changes to be handled and checking behavior after those have been processed
New request that returns symbols for all the test classes and test methods within the current workspace.
843
876
877
+
> [!NOTE]
878
+
> This request was previously named `workspace/tests`. The old name is still accepted for backward compatibility.
879
+
844
880
- params: `WorkspaceTestsParams`
845
881
- result: `TestItem[]`
846
882
847
883
```ts
848
884
exportinterfaceWorkspaceTestsParams {}
849
885
```
850
886
851
-
## `workspace/triggerReindex`
887
+
## `sourcekit/workspace/triggerReindex`
852
888
853
889
New request to re-index all files open in the SourceKit-LSP server.
854
890
855
891
Users should not need to rely on this request. The index should always be updated automatically in the background. Having to invoke this request means there is a bug in SourceKit-LSP's automatic re-indexing. It does, however, offer a workaround to re-index files when such a bug occurs where otherwise there would be no workaround.
856
892
893
+
> [!NOTE]
894
+
> This request was previously named `workspace/triggerReindex`. The old name is still accepted for backward compatibility.
0 commit comments