Verified Owner
Top Fields Constructors Methods
org.jabref.languageserver

public Class LspClientHandler

extends Object
implements LanguageServer, LanguageClientAware
Class Inheritance
All Implemented Interfaces
org.eclipse.lsp4j.services.LanguageClientAware, org.eclipse.lsp4j.services.LanguageServer
Imports
java.util.concurrent.CompletableFuture, org.jabref.languageserver.util.LspDiagnosticHandler, .LspLinkHandler, .LspParserHandler, org.jabref.logic.journals.JournalAbbreviationRepository, org.jabref.logic.preferences.CliPreferences, org.jabref.logic.remote.server.RemoteMessageHandler, org.jabref.model.entry.BibEntryTypesManager, org.eclipse.lsp4j.DocumentLinkOptions, .InitializeParams, .InitializeResult, .MessageParams, .MessageType, .ServerCapabilities, .TextDocumentSyncKind, .TextDocumentSyncOptions, .WorkspaceServerCapabilities, org.eclipse.lsp4j.services.LanguageClient, .LanguageClientAware, .LanguageServer, .TextDocumentService, .WorkspaceService, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private LanguageClient
private final LspDiagnosticHandler
private final LspLinkHandler
private static final Logger
private final RemoteMessageHandler
private final LspParserHandler
private final ExtensionSettings
private boolean
private final BibtexTextDocumentService
private final BibtexWorkspaceService

Constructor Summary

AccessConstructor and Description
public
LspClientHandler(RemoteMessageHandler messageHandler, CliPreferences cliPreferences, JournalAbbreviationRepository abbreviationRepository, BibEntryTypesManager bibEntryTypesManager)

public
LspClientHandler(RemoteMessageHandler messageHandler, CliPreferences cliPreferences, JournalAbbreviationRepository abbreviationRepository, BibEntryTypesManager bibEntryTypesManager, boolean standalone)

Method Summary

Modifier and TypeMethod and Description
public void
public void
exit()

Implements org.eclipse.lsp4j.services.LanguageServer.exit.

When running in JabGui: NOOP, because the JabGui has the lifecycle control.

public ExtensionSettings
public TextDocumentService
getTextDocumentService()

Implements org.eclipse.lsp4j.services.LanguageServer.getTextDocumentService.

Provides access to the textDocument services.

public WorkspaceService
getWorkspaceService()

Implements org.eclipse.lsp4j.services.LanguageServer.getWorkspaceService.

Provides access to the workspace services.

public CompletableFuture<InitializeResult>
initialize(InitializeParams params)

Implements org.eclipse.lsp4j.services.LanguageServer.initialize.

The initialize request is sent as the first request from the client to the server.

public boolean
public CompletableFuture<Object>
shutdown()

Implements org.eclipse.lsp4j.services.LanguageServer.shutdown.

The shutdown request is sent from the client to the server.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

clientback to summary
private LanguageClient client
diagnosticHandlerback to summary
private final LspDiagnosticHandler diagnosticHandler
linkHandlerback to summary
private final LspLinkHandler linkHandler
LOGGERback to summary
private static final Logger LOGGER
messageHandlerback to summary
private final RemoteMessageHandler messageHandler
parserHandlerback to summary
private final LspParserHandler parserHandler
settingsback to summary
private final ExtensionSettings settings
standaloneback to summary
private boolean standalone
textDocumentServiceback to summary
private final BibtexTextDocumentService textDocumentService
workspaceServiceback to summary
private final BibtexWorkspaceService workspaceService

Constructor Detail

LspClientHandlerback to summary
public LspClientHandler(RemoteMessageHandler messageHandler, CliPreferences cliPreferences, JournalAbbreviationRepository abbreviationRepository, BibEntryTypesManager bibEntryTypesManager)
LspClientHandlerback to summary
public LspClientHandler(RemoteMessageHandler messageHandler, CliPreferences cliPreferences, JournalAbbreviationRepository abbreviationRepository, BibEntryTypesManager bibEntryTypesManager, boolean standalone)

Method Detail

connectback to summary
public void connect(LanguageClient client)

Implements org.eclipse.lsp4j.services.LanguageClientAware.connect.

Annotations
@Override
exitback to summary
public void exit()

Implements org.eclipse.lsp4j.services.LanguageServer.exit.

When running in JabGui: NOOP, because the JabGui has the lifecycle control. When running standalone: immediately exits. We accept issues if mutlitple clients are connected.

Annotations
@Override
getSettingsback to summary
public ExtensionSettings getSettings()
getTextDocumentServiceback to summary
public TextDocumentService getTextDocumentService()

Implements org.eclipse.lsp4j.services.LanguageServer.getTextDocumentService.

Doc from org.eclipse.lsp4j.services.LanguageServer.getTextDocumentService.

Provides access to the textDocument services.

Annotations
@Override
getWorkspaceServiceback to summary
public WorkspaceService getWorkspaceService()

Implements org.eclipse.lsp4j.services.LanguageServer.getWorkspaceService.

Doc from org.eclipse.lsp4j.services.LanguageServer.getWorkspaceService.

Provides access to the workspace services.

Annotations
@Override
initializeback to summary
public CompletableFuture<InitializeResult> initialize(InitializeParams params)

Implements org.eclipse.lsp4j.services.LanguageServer.initialize.

Doc from org.eclipse.lsp4j.services.LanguageServer.initialize.

The initialize request is sent as the first request from the client to the server.

If the server receives requests or notifications before the initialize request, it should act as follows:

Until the server has responded to the initialize request with an InitializeResult, the client must not send any additional requests or notifications to the server.

During the initialize request, the server is allowed to send the notifications window/showMessage, window/logMessage, and telemetry/event, as well as the request window/showMessageRequest, to the client.

Annotations
@Override
isStandaloneback to summary
public boolean isStandalone()
shutdownback to summary
public CompletableFuture<Object> shutdown()

Implements org.eclipse.lsp4j.services.LanguageServer.shutdown.

Doc from org.eclipse.lsp4j.services.LanguageServer.shutdown.

The shutdown request is sent from the client to the server. It asks the server to shutdown, 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.

Annotations
@Override