Skip to content

Commit e5fc5a8

Browse files
committed
refactor(session): rename sess_app to connect in sess package
1 parent 89f8296 commit e5fc5a8

6 files changed

Lines changed: 15 additions & 13 deletions

File tree

R/profile.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ local({
2525
})
2626

2727
if (requireNamespace("sess", quietly = TRUE)) {
28-
sess::sess_app(
28+
sess::connect(
2929
use_rstudioapi = as.logical(Sys.getenv("SESS_RSTUDIOAPI", "TRUE")),
3030
use_httpgd = as.logical(Sys.getenv("SESS_USE_HTTPGD", "TRUE"))
3131
)

sess/DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ Imports:
1616
methods,
1717
rstudioapi,
1818
svglite
19-
RoxygenNote: 7.3.3
19+
Config/roxygen2/version: 8.0.0

sess/NAMESPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Generated by roxygen2: do not edit by hand
22

3+
export(connect)
34
export(notify_client)
45
export(register_hooks)
56
export(request_client)
6-
export(sess_app)

sess/R/server.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#' be enabled? Defaults to TRUE.
88
#' @param use_httpgd Logical. Should httpgd be used for plotting if available? Defaults to TRUE
99
#' @export
10-
sess_app <- function(port = NULL, token = NULL, use_rstudioapi = TRUE, use_httpgd = TRUE) {
10+
connect <- function(port = NULL, token = NULL, use_rstudioapi = TRUE, use_httpgd = TRUE) {
1111
# Initialize state
1212
.sess_env$server <- NULL
1313
.sess_env$ws <- NULL
@@ -55,7 +55,7 @@ sess_app <- function(port = NULL, token = NULL, use_rstudioapi = TRUE, use_httpg
5555
cat(sprintf("\r%s\n\n%s", msg, prompt))
5656
}
5757

58-
connect <- function() {
58+
do_connect <- function() {
5959
url <- sprintf("ws://127.0.0.1:%s/?token=%s", port, token)
6060
ws <- websocket::WebSocket$new(
6161
url,
@@ -152,7 +152,7 @@ sess_app <- function(port = NULL, token = NULL, use_rstudioapi = TRUE, use_httpg
152152
token <<- config$token
153153
}, error = function(e) NULL)
154154
}
155-
connect()
155+
do_connect()
156156
}, 5)
157157
})
158158

@@ -164,7 +164,7 @@ sess_app <- function(port = NULL, token = NULL, use_rstudioapi = TRUE, use_httpg
164164
}
165165

166166
# Connect to VS Code
167-
connect()
167+
do_connect()
168168

169169
# Register runtime hooks
170170
if (is.na(use_rstudioapi)) use_rstudioapi <- TRUE
Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/session.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ export async function sessionRequest(server: SessionServer, data: Record<string,
10161016

10171017
export async function connectToSession(): Promise<void> {
10181018
const { port, token } = await getGlobalSessionServer();
1019-
const command = `sess::sess_app(port=${port}, token="${token}")`;
1019+
const command = `sess::connect(port=${port}, token="${token}")`;
10201020
void vscode.env.clipboard.writeText(command);
10211021
void vscode.window.showInformationMessage(`R command copied to clipboard: ${command}`);
10221022
}

0 commit comments

Comments
 (0)