Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions R/thread.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ py_run_file_on_thread <- function(file, ..., args = NULL) {
basename(dirname(file)) %in% c("positron", "posit"))

if (launching_lsp) {
# this is equivalent to the result of .getIpykernelPath UI command.
.globals$positron_ipykernel_path <- file.path(dirname(file), "positron")

main_dict <- py_eval("__import__('__main__').__dict__.copy()", FALSE)
py_get_attr(main_dict, "pop")("__annotations__")
# IPykernel will create a thread that redirects all output from fileno of
Expand Down
4 changes: 3 additions & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ register_ark_methods <- function() {
# which will be needed for the variable inspectors and for help handlers
# this can'rt be executed during handling of RPC's, so it's important that it's cached.
.ps.ui.executeCommand <- get(".ps.ui.executeCommand", globalenv())
.globals$positron_ipykernel_path <- .ps.ui.executeCommand("positron.reticulate.getIPykernelPath")
if (is.null(.globals$positron_ipykernel_path)) {
.globals$positron_ipykernel_path <- .ps.ui.executeCommand("positron.reticulate.getIPykernelPath")
}

# register help handler
tryCatch({
Expand Down