Skip to contents

Start a language server for an editor that supports the Language Server Protocol. The running server processes editor requests until the client shuts it down.

Usage

run(debug = FALSE, host = "localhost", port = NULL)

Arguments

debug

(logical | character) With the default FALSE, use the configured logging settings. TRUE enables diagnostic logging to standard error. A character file path enables diagnostic logging and appends messages to that file.

host

(character) Host of the client's listening TCP socket when port is set.

port

(numeric | NULL) With the default NULL, read messages from standard input and write replies to standard output. Supply a port number to connect to a TCP listener that the client has already opened on host.

Details

An editor extension normally starts the R process. To configure a generic client for standard input and output (stdio), select an R installation that has access to this package and give the client this launch command.

R --no-echo -e "languageserver::run()"

For separate command and argument fields, use R as the executable and pass --no-echo, -e, and languageserver::run() as three arguments.

See also

Examples

if (FALSE) { # \dontrun{
# Standard input and output
languageserver::run()

# Connect to a client already listening on localhost, port 8888
languageserver::run(port = 8888)
} # }