Package ch.epfl.scala.bsp4j
Interface BuildServer
-
public interface BuildServer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<InitializeBuildResult>buildInitialize(InitializeBuildParams params)Like the language server protocol, the initialize request is sent as the first request from the client to the server.java.util.concurrent.CompletableFuture<java.lang.Object>buildShutdown()Like the language server protocol, the shutdown build request is sent from the client to the server.java.util.concurrent.CompletableFuture<CleanCacheResult>buildTargetCleanCache(CleanCacheParams params)The clean cache request is sent from the client to the server to reset any state associated with a given build target.java.util.concurrent.CompletableFuture<CompileResult>buildTargetCompile(CompileParams params)The compile build target request is sent from the client to the server to compile the given list of build targets.java.util.concurrent.CompletableFuture<DependencyModulesResult>buildTargetDependencyModules(DependencyModulesParams params)The build target dependency modules request is sent from the client to the server to query for the libraries of build target dependencies that are external to the workspace including meta information about library and their sources.java.util.concurrent.CompletableFuture<DependencySourcesResult>buildTargetDependencySources(DependencySourcesParams params)The build target dependency sources request is sent from the client to the server to query for the sources of build target dependencies that are external to the workspace.java.util.concurrent.CompletableFuture<InverseSourcesResult>buildTargetInverseSources(InverseSourcesParams params)The inverse sources request is sent from the client to the server to query for the list of build targets containing a text document.java.util.concurrent.CompletableFuture<OutputPathsResult>buildTargetOutputPaths(OutputPathsParams params)The build target output paths request is sent from the client to the server to query for the list of output paths of a given list of build targets.java.util.concurrent.CompletableFuture<ResourcesResult>buildTargetResources(ResourcesParams params)The build target resources request is sent from the client to the server to query for the list of resources of a given list of build targets.java.util.concurrent.CompletableFuture<RunResult>buildTargetRun(RunParams params)The run request is sent from the client to the server to run a build target.java.util.concurrent.CompletableFuture<SourcesResult>buildTargetSources(SourcesParams params)The build target sources request is sent from the client to the server to query for the list of text documents and directories that are belong to a build target.java.util.concurrent.CompletableFuture<TestResult>buildTargetTest(TestParams params)The test build target request is sent from the client to the server to test the given list of build targets.java.util.concurrent.CompletableFuture<DebugSessionAddress>debugSessionStart(DebugSessionParams params)The debug request is sent from the client to the server to debug build target(s).voidonBuildExit()Like the language server protocol, a notification to ask the server to exit its process.voidonBuildInitialized()Like the language server protocol, the initialized notification is sent from the client to the server after the client received the result of the initialize request but before the client is sending any other request or notification to the server.java.util.concurrent.CompletableFuture<WorkspaceBuildTargetsResult>workspaceBuildTargets()The workspace build targets request is sent from the client to the server to ask for the list of all available build targets in the workspace.java.util.concurrent.CompletableFuture<java.lang.Object>workspaceReload()The `reload` request is sent from the client to instruct the build server to reload the build configuration.
-
-
-
Method Detail
-
buildInitialize
java.util.concurrent.CompletableFuture<InitializeBuildResult> buildInitialize(InitializeBuildParams params)
Like the language server protocol, the initialize request is sent as the first request from the client to the server. If the server receives a request or notification before the initialize request it should act as follows: * For a request the response should be an error with code: -32002. The message can be picked by the server. * Notifications should be dropped, except for the exit notification. This will allow the exit of a server without an initialize request. Until the server has responded to the initialize request with an InitializeBuildResult, the client must not send any additional requests or notifications to the server.
-
onBuildInitialized
void onBuildInitialized()
Like the language server protocol, the initialized notification is sent from the client to the server after the client received the result of the initialize request but before the client is sending any other request or notification to the server. The server can use the initialized notification for example to initialize intensive computation such as dependency resolution or compilation. The initialized notification may only be sent once.
-
buildShutdown
java.util.concurrent.CompletableFuture<java.lang.Object> buildShutdown()
Like the language server protocol, the shutdown build request is sent from the client to the server. It asks the server to shut down, but to not exit (otherwise the response might not be delivered correctly to the client). There is a separate exit notification that asks the server to exit.
-
onBuildExit
void onBuildExit()
Like the language server protocol, a notification to ask the server to exit its process. The server should exit with success code 0 if the shutdown request has been received before; otherwise with error code 1.
-
workspaceBuildTargets
java.util.concurrent.CompletableFuture<WorkspaceBuildTargetsResult> workspaceBuildTargets()
The workspace build targets request is sent from the client to the server to ask for the list of all available build targets in the workspace.
-
workspaceReload
java.util.concurrent.CompletableFuture<java.lang.Object> workspaceReload()
The `reload` request is sent from the client to instruct the build server to reload the build configuration. This request should be supported by build tools that keep their state in memory. If the `reload` request returns with an error, it's expected that other requests respond with the previously known "good" state.
-
buildTargetSources
java.util.concurrent.CompletableFuture<SourcesResult> buildTargetSources(SourcesParams params)
The build target sources request is sent from the client to the server to query for the list of text documents and directories that are belong to a build target. The sources response must not include sources that are external to the workspace, see `buildTarget/dependencySources`.
-
buildTargetInverseSources
java.util.concurrent.CompletableFuture<InverseSourcesResult> buildTargetInverseSources(InverseSourcesParams params)
The inverse sources request is sent from the client to the server to query for the list of build targets containing a text document. The server communicates during the initialize handshake whether this method is supported or not. This request can be viewed as the inverse of `buildTarget/sources`, except it only works for text documents and not directories.
-
buildTargetDependencySources
java.util.concurrent.CompletableFuture<DependencySourcesResult> buildTargetDependencySources(DependencySourcesParams params)
The build target dependency sources request is sent from the client to the server to query for the sources of build target dependencies that are external to the workspace. The dependency sources response must not include source files that belong to a build target within the workspace, see `buildTarget/sources`. The server communicates during the initialize handshake whether this method is supported or not. This method can for example be used by a language server on `textDocument/definition` to "Go to definition" from project sources to dependency sources.
-
buildTargetDependencyModules
java.util.concurrent.CompletableFuture<DependencyModulesResult> buildTargetDependencyModules(DependencyModulesParams params)
The build target dependency modules request is sent from the client to the server to query for the libraries of build target dependencies that are external to the workspace including meta information about library and their sources. It's an extended version of `buildTarget/sources`.
-
buildTargetResources
java.util.concurrent.CompletableFuture<ResourcesResult> buildTargetResources(ResourcesParams params)
The build target resources request is sent from the client to the server to query for the list of resources of a given list of build targets. A resource is a data dependency required to be present in the runtime classpath when a build target is run or executed. The server communicates during the initialize handshake whether this method is supported or not. This request can be used by a client to highlight the resources in a project view, for example.
-
buildTargetOutputPaths
java.util.concurrent.CompletableFuture<OutputPathsResult> buildTargetOutputPaths(OutputPathsParams params)
The build target output paths request is sent from the client to the server to query for the list of output paths of a given list of build targets. An output path is a file or directory that contains output files such as build artifacts which IDEs may decide to exclude from indexing. The server communicates during the initialize handshake whether this method is supported or not.
-
buildTargetCompile
java.util.concurrent.CompletableFuture<CompileResult> buildTargetCompile(CompileParams params)
The compile build target request is sent from the client to the server to compile the given list of build targets. The server communicates during the initialize handshake whether this method is supported or not. This method can for example be used by a language server before `textDocument/rename` to ensure that all workspace sources typecheck correctly and are up-to-date.
-
buildTargetRun
java.util.concurrent.CompletableFuture<RunResult> buildTargetRun(RunParams params)
The run request is sent from the client to the server to run a build target. The server communicates during the initialize handshake whether this method is supported or not. This request may trigger a compilation on the selected build targets. The server is free to send any number of `build/task*`, `build/publishDiagnostics` and `build/logMessage` notifications during compilation before completing the response. The client will get a `originId` field in `RunResult` if the `originId` field in the `RunParams` is defined. Note that an empty run request is valid. Run will be executed in the target as specified in the build tool.
-
buildTargetTest
java.util.concurrent.CompletableFuture<TestResult> buildTargetTest(TestParams params)
The test build target request is sent from the client to the server to test the given list of build targets. The server communicates during the initialize handshake whether this method is supported or not.
-
debugSessionStart
java.util.concurrent.CompletableFuture<DebugSessionAddress> debugSessionStart(DebugSessionParams params)
The debug request is sent from the client to the server to debug build target(s). The server launches a [Microsoft DAP](https://microsoft.github.io/debug-adapter-protocol/) server and returns a connection URI for the client to interact with.
-
buildTargetCleanCache
java.util.concurrent.CompletableFuture<CleanCacheResult> buildTargetCleanCache(CleanCacheParams params)
The clean cache request is sent from the client to the server to reset any state associated with a given build target. The state can live either in the build tool or in the file system. The build tool defines the exact semantics of the clean cache request: 1. Stateless build tools are free to ignore the request and respond with a successful response. 2. Stateful build tools must ensure that invoking compilation on a target that has been cleaned results in a full compilation.
-
-