Top Methods
org.eclipse.lsp4j.services

public Interface LanguageClient

Known Direct Subinterfaces
org.eclipse.lsp4j.services.LanguageClientExtensions
Imports
java.util.List, java.util.concurrent.CompletableFuture, org.eclipse.lsp4j.ApplyWorkspaceEditParams, .ApplyWorkspaceEditResponse, .ConfigurationParams, .LogTraceParams, .MessageActionItem, .MessageParams, .ProgressParams, .PublishDiagnosticsParams, .RegistrationParams, .ShowDocumentParams, .ShowDocumentResult, .ShowMessageRequestParams, .UnregistrationParams, .WorkDoneProgressCreateParams, .WorkspaceFolder, org.eclipse.lsp4j.jsonrpc.services.JsonNotification, .JsonRequest

Method Summary

Modifier and TypeMethod and Description
public default CompletableFuture<ApplyWorkspaceEditResponse>
applyEdit(ApplyWorkspaceEditParams params)

The workspace/applyEdit request is sent from the server to the client to modify resource on the client side.

public default CompletableFuture<List<Object>>
configuration(ConfigurationParams configurationParams)

The workspace/configuration request is sent from the server to the client to fetch configuration settings from the client.

public default CompletableFuture<Void>
createProgress(WorkDoneProgressCreateParams params)

This request is sent from the server to the client to ask the client to create a work done progress.

public void
logMessage(MessageParams message)

The log message notification is send from the server to the client to ask the client to log a particular message.

public default void
logTrace(LogTraceParams params)

A notification to log the trace of the server's execution.

public default void
notifyProgress(ProgressParams params)

The base protocol offers also support to report progress in a generic fashion.

public void
publishDiagnostics(PublishDiagnosticsParams diagnostics)

Diagnostics notifications are sent from the server to the client to signal results of validation runs.

public default CompletableFuture<Void>
refreshCodeLenses()

The workspace/codeLens/refresh request is sent from the server to the client.

public default CompletableFuture<Void>
refreshDiagnostics()

The workspace/diagnostic/refresh request is sent from the server to the client.

public default CompletableFuture<Void>
refreshInlayHints()

The workspace/inlayHint/refresh request is sent from the server to the client.

public default CompletableFuture<Void>
refreshInlineValues()

The workspace/inlineValue/refresh request is sent from the server to the client.

public default CompletableFuture<Void>
refreshSemanticTokens()

The workspace/semanticTokens/refresh request is sent from the server to the client.

public default CompletableFuture<Void>
registerCapability(RegistrationParams params)

The client/registerCapability request is sent from the server to the client to register for a new capability on the client side.

public default CompletableFuture<ShowDocumentResult>
showDocument(ShowDocumentParams params)

The show document request is sent from a server to a client to ask the client to display a particular document in the user interface.

public void
showMessage(MessageParams messageParams)

The show message notification is sent from a server to a client to ask the client to display a particular message in the user interface.

public CompletableFuture<MessageActionItem>
showMessageRequest(ShowMessageRequestParams requestParams)

The show message request is sent from a server to a client to ask the client to display a particular message in the user interface.

public void
telemetryEvent(Object object)

The telemetry notification is sent from the server to the client to ask the client to log a telemetry event.

public default CompletableFuture<Void>
unregisterCapability(UnregistrationParams params)

The client/unregisterCapability request is sent from the server to the client to unregister a previously register capability.

public default CompletableFuture<List<WorkspaceFolder>>

Returns:

null in the response if only a single file is open in the tool, an empty array if a workspace is open but no folders are configured, the workspace folders otherwise.
workspaceFolders
()

The workspace/workspaceFolders request is sent from the server to the client to fetch the current open list of workspace folders.

Method Detail

applyEditback to summary
public default CompletableFuture<ApplyWorkspaceEditResponse> applyEdit(ApplyWorkspaceEditParams params)

The workspace/applyEdit request is sent from the server to the client to modify resource on the client side.

Annotations
@JsonRequest:workspace/applyEdit
configurationback to summary
public default CompletableFuture<List<Object>> configuration(ConfigurationParams configurationParams)

The workspace/configuration request is sent from the server to the client to fetch configuration settings from the client. The request can fetch several configuration settings in one roundtrip. The order of the returned configuration settings correspond to the order of the passed ConfigurationItems (e.g. the first item in the response is the result for the first configuration item in the params).

Since 3.6.0

Annotations
@JsonRequest:workspace/configuration
createProgressback to summary
public default CompletableFuture<Void> createProgress(WorkDoneProgressCreateParams params)

This request is sent from the server to the client to ask the client to create a work done progress.

Since 3.15.0

Annotations
@JsonRequest:window/workDoneProgress/create
logMessageback to summary
public void logMessage(MessageParams message)

The log message notification is send from the server to the client to ask the client to log a particular message.

Annotations
@JsonNotification:window/logMessage
logTraceback to summary
public default void logTrace(LogTraceParams params)

A notification to log the trace of the server's execution. The amount and content of these notifications depends on the current trace configuration. If trace is 'off', the server should not send any logTrace notification. If trace is 'message', the server should not add the 'verbose' field in the LogTraceParams.

$/logTrace should be used for systematic trace reporting. For single debugging messages, the server should send window/logMessage notifications.

Since 3.16.0

Annotations
@JsonNotification:$/logTrace
notifyProgressback to summary
public default void notifyProgress(ProgressParams params)

The base protocol offers also support to report progress in a generic fashion. This mechanism can be used to report any kind of progress including work done progress (usually used to report progress in the user interface using a progress bar) and partial result progress to support streaming of results.

Since 3.15.0

Annotations
@JsonNotification:$/progress
publishDiagnosticsback to summary
public void publishDiagnostics(PublishDiagnosticsParams diagnostics)

Diagnostics notifications are sent from the server to the client to signal results of validation runs.

Annotations
@JsonNotification:textDocument/publishDiagnostics
refreshCodeLensesback to summary
public default CompletableFuture<Void> refreshCodeLenses()

The workspace/codeLens/refresh request is sent from the server to the client. Servers can use it to ask clients to refresh the code lenses currently shown in editors. As a result the client should ask the server to recompute the code lenses for these editors. This is useful if a server detects a configuration change which requires a re-calculation of all code lenses. Note that the client still has the freedom to delay the re-calculation of the code lenses if for example an editor is currently not visible.

Since 3.16.0

Annotations
@JsonRequest:workspace/codeLens/refresh
refreshDiagnosticsback to summary
public default CompletableFuture<Void> refreshDiagnostics()

The workspace/diagnostic/refresh request is sent from the server to the client. Servers can use it to ask clients to refresh all needed document and workspace diagnostics. This is useful if a server detects a project wide configuration change which requires a re-calculation of all diagnostics.

Since 3.17.0

Annotations
@JsonRequest:workspace/diagnostic/refresh
refreshInlayHintsback to summary
public default CompletableFuture<Void> refreshInlayHints()

The workspace/inlayHint/refresh request is sent from the server to the client. Servers can use it to ask clients to refresh the inlay hints currently shown in editors. As a result the client should ask the server to recompute the inlay hints for these editors. This is useful if a server detects a configuration change which requires a re-calculation of all inlay hints. Note that the client still has the freedom to delay the re-calculation of the inlay hints if for example an editor is currently not visible.

Since 3.17.0

Annotations
@JsonRequest:workspace/inlayHint/refresh
refreshInlineValuesback to summary
public default CompletableFuture<Void> refreshInlineValues()

The workspace/inlineValue/refresh request is sent from the server to the client. Servers can use it to ask clients to refresh the inline values currently shown in editors. As a result the client should ask the server to recompute the inline values for these editors. This is useful if a server detects a configuration change which requires a re-calculation of all inline values. Note that the client still has the freedom to delay the re-calculation of the inline values if for example an editor is currently not visible.

Since 3.17.0

Annotations
@JsonRequest:workspace/inlineValue/refresh
refreshSemanticTokensback to summary
public default CompletableFuture<Void> refreshSemanticTokens()

The workspace/semanticTokens/refresh request is sent from the server to the client. Servers can use it to ask clients to refresh the editors for which this server provides semantic tokens. As a result the client should ask the server to recompute the semantic tokens for these editors. This is useful if a server detects a project wide configuration change which requires a re-calculation of all semantic tokens. Note that the client still has the freedom to delay the re-calculation of the semantic tokens if for example an editor is currently not visible.

Since 3.16.0

Annotations
@JsonRequest:workspace/semanticTokens/refresh
registerCapabilityback to summary
public default CompletableFuture<Void> registerCapability(RegistrationParams params)

The client/registerCapability request is sent from the server to the client to register for a new capability on the client side. Not all clients need to support dynamic capability registration. A client opts in via the ClientCapabilities.dynamicRegistration property

Annotations
@JsonRequest:client/registerCapability
showDocumentback to summary
public default CompletableFuture<ShowDocumentResult> showDocument(ShowDocumentParams params)

The show document request is sent from a server to a client to ask the client to display a particular document in the user interface.

Since 3.16.0

Annotations
@JsonRequest:window/showDocument
showMessageback to summary
public void showMessage(MessageParams messageParams)

The show message notification is sent from a server to a client to ask the client to display a particular message in the user interface.

Annotations
@JsonNotification:window/showMessage
showMessageRequestback to summary
public CompletableFuture<MessageActionItem> showMessageRequest(ShowMessageRequestParams requestParams)

The show message request is sent from a server to a client to ask the client to display a particular message in the user interface. In addition to the show message notification the request allows to pass actions and to wait for an answer from the client.

Annotations
@JsonRequest:window/showMessageRequest
telemetryEventback to summary
public void telemetryEvent(Object object)

The telemetry notification is sent from the server to the client to ask the client to log a telemetry event.

Annotations
@JsonNotification:telemetry/event
unregisterCapabilityback to summary
public default CompletableFuture<Void> unregisterCapability(UnregistrationParams params)

The client/unregisterCapability request is sent from the server to the client to unregister a previously register capability.

Annotations
@JsonRequest:client/unregisterCapability
workspaceFoldersback to summary
public default CompletableFuture<List<WorkspaceFolder>> workspaceFolders()

The workspace/workspaceFolders request is sent from the server to the client to fetch the current open list of workspace folders.

Since 3.6.0

Returns:CompletableFuture<List<WorkspaceFolder>>

null in the response if only a single file is open in the tool, an empty array if a workspace is open but no folders are configured, the workspace folders otherwise.

Annotations
@JsonRequest:workspace/workspaceFolders