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
Make workspace/synchronize a non-experimental request
This request is generally useful, not only for tests within SourceKit-LSP but also:
- In editor tests that want to test the integration with SourceKit-LSP
- In code analysis tools that want to gather project information using SourceKit-LSP and need an up-to-date index for that.
Remove the experimental feature guard from `workspace/_synchronize`, consequently rename it to `workspace/synchronize` and only guard the `buildServerUpdates` option on the synchronize request by an experimental feature because its long-term usefulness is still not fully understood yet.
New 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.
670
-
671
-
> [!IMPORTANT]
672
-
> This request is experimental, guarded behind the `synchronize-request` experimental feature and may be modified or removed in future versions of SourceKit-LSP without notice. Do not rely on it.
673
-
674
-
- params: `SynchronizeParams`
675
-
- result: `void`
676
-
677
-
```ts
678
-
exportinterfaceSynchronizeParams {
679
-
/**
680
-
* Wait for the build server to have an up-to-date build graph by sending a `workspace/waitForBuildSystemUpdates` to
681
-
* it.
682
-
*/
683
-
buildServerUpdates?: bool
684
-
685
-
/**
686
-
* Wait for background indexing to finish and all index unit files to be loaded into indexstore-db.
687
-
*
688
-
* Implies `buildServerUpdates = true`.
689
-
*/
690
-
index?:bool
691
-
}
692
-
```
693
-
694
667
## `workspace/_outputPaths`
695
668
696
669
New request from the client to the server to retrieve the output paths of a target (see the `buildTarget/outputPaths` BSP request).
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.
768
+
769
+
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:
770
+
- Automated tests that need to wait for background indexing to finish and then checking the result of request results
771
+
- Automated tests that need to wait for requests like file changes to be handled and checking behavior after those have been processed
772
+
- Code analysis tools that want to use SourceKit-LSP to gather information about the project but can only do so after the index has been loaded
773
+
774
+
Because this request waits for all other SourceKit-LSP requests to finish, it limits parallel request handling and is ill-suited for any kind of interactive environment. In those environments, it is preferable to quickly give the user a result based on the data that is available and (let the user) re-perform the action if the underlying index data has changed.
775
+
776
+
- params: `SynchronizeParams`
777
+
- result: `void`
778
+
779
+
```ts
780
+
exportinterfaceSynchronizeParams {
781
+
/**
782
+
* Wait for the build server to have an up-to-date build graph by sending a `workspace/waitForBuildSystemUpdates` to
783
+
* it.
784
+
*
785
+
* This is implied by `index = true`.
786
+
*
787
+
* This option is experimental, guarded behind the `synchronize-for-build-system-updates` experimental feature, and
788
+
* may be modified or removed in future versions of SourceKit-LSP without notice. Do not rely on it.
789
+
*/
790
+
buildServerUpdates?: bool
791
+
792
+
/**
793
+
* Wait for background indexing to finish and all index unit files to be loaded into indexstore-db.
794
+
*/
795
+
index?:bool
796
+
}
797
+
```
798
+
792
799
## `workspace/tests`
793
800
794
801
New request that returns symbols for all the test classes and test methods within the current workspace.
0 commit comments