Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R commands submitted as multi-line selection report back from Console out of order #4264

Closed
tghoward opened this issue Aug 7, 2024 · 3 comments
Labels
area: console Issues related to Console category. bug Something isn't working lang: r support

Comments

@tghoward
Copy link

tghoward commented Aug 7, 2024

System details:

Positron and OS details:

Positron Version: 2024.08.0 (system setup) build 5
Code - OSS Version: 1.91.0
Commit: Unknown
Date: 2024-08-06T16:06:18.274Z
Electron: 29.4.0
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Windows_NT x64 10.0.19045

Interpreter details:

R version 4.4.0 (2024-04-24 ucrt) -- "Puppy Cup"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64

Describe the issue:

If I select a bunch of lines and submit them at once, the result reported in the console doesn't always follow the same sequence as the lines submitted. This is different than the behavior in RStudio. "Source file" does follow the sequence. Possibly related to #4068 ?

Steps to reproduce the issue:

this script consistently does it for me. Select all then submit as a single chunk (ctrl-enter if using RStudio shortcuts).

library(sf)
print("start block")
st_layers(system.file("shape", package = "sf"))
print("mid block")
Sys.sleep(0.6)
2+2
nc <- st_read(system.file("shape/nc.shp", package = "sf"))
print("end block")

This is what I get:

image

text version of output:

library(sf)

  • print("start block")
  • st_layers(system.file("shape", package = "sf"))
  • print("mid block")
  • Sys.sleep(0.6)
  • 2+2
  • nc <- st_read(system.file("shape/nc.shp", package = "sf"))
  • print("end block")
    [1] "start block"
    [1] "mid block"
    Reading layer nc' from data source F:\softwareInstalls\R_packages\sf\shape\nc.shp' using driver `ESRI Shapefile'
    Simple feature collection with 100 features and 14 fields
    Geometry type: MULTIPOLYGON
    Dimension: XY
    Bounding box: xmin: -84.32385 ymin: 33.88199 xmax: -75.45698 ymax: 36.58965
    Geodetic CRS: NAD27
    [1] "end block"
    Driver: ESRI Shapefile
    Available layers:
    layer_name geometry_type features fields crs_name
    1 nc Polygon 100 14 NAD27
    2 olinda1 Polygon 470 6 GRS 1980(IUGG, 1980)
    3 storms_xyz 3D Line String 71 0
    4 storms_xyzm Measured Line String 71 0
    5 storms_xyzm_feature Measured Line String 71 1
    6 storms_xyz_feature 3D Line String 71 1
    [1] 4

Which shows the "st_layers" and "2+2" lines reporting back from the Console last.

Expected or desired behavior:

I would have expected "st_layers" result to show before the results from the commands that come after it. This is the way it behaves in RStudio and when the file is sourced.

Were there any error messages in the UI, Output panel, or Developer Tools console?

no errors that I see, but I didn't look far.

@DavisVaughan
Copy link
Contributor

I think this is different from #4068

@jmcphers jmcphers added lang: r area: console Issues related to Console category. labels Aug 7, 2024
@jmcphers
Copy link
Collaborator

jmcphers commented Aug 7, 2024

Related to #1762 and #1326. I think the right fix here is to submit these as individual statements and wait for each one to run to completion before running the next one. That will remove any possibility of their output getting tangled up.

@DavisVaughan
Copy link
Contributor

This works correctly for me now. I think when we switched ark to working 1 line at a time this vastly improved things

Image

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: console Issues related to Console category. bug Something isn't working lang: r support
Projects
None yet
Development

No branches or pull requests

5 participants