You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running a line of code with Cmd + Enter does not work as expected (or as it does in RStudio) when using semi-colons to separate commands. I know this is probably not a recommend practice, but nevertheless it should probably work.
x=1; y=2; z=3
Running this will create x only and jump down the editor to the next command on a new line, but does not create y or z. In RStudio all three objects would be created, and this is what happens if you run the code directly in the console.
The text was updated successfully, but these errors were encountered:
Can confirm! Happens because we try to run one statement at a time and this is (technically) three statements. Agree the behavior doesn't make sense, though; RStudio's behavior is would be preferable.
I happened to be in the vicinity of this today. A few things to note about what ark does:
Consider 1; 2
Regardless of where you put your cursor in there, ark sends back [(0, 0), (0, 1)] as the Range to execute. This is because ark actually ignores the column position of the cursor, and only uses the row position of the cursor and works from there.
Semicolons currently don't exist in the tree-sitter-r grammar. i.e. you see a float at [(0, 0), (0, 1)] and another float at [(0, 3), (0, 4)] and everything else looks like whitespace.
Given that we don't see semicolons, I'm not 100% sure what to do to fix this yet. But it's probably something like
"if the end column of the node you are about to select doesn't end at the end of the line (and there isnt a trailing comment), then you probably have something else on this line, so expand your node search and don't return this partial line node"
Or maybe similarly we could check if the following sibling starts on the same line as the node ends on, which I think can only happen if there is a semicolon. That seems like it may work as a signal to keep expanding.
Hi,
Running a line of code with
Cmd + Enter
does not work as expected (or as it does in RStudio) when using semi-colons to separate commands. I know this is probably not a recommend practice, but nevertheless it should probably work.Running this will create
x
only and jump down the editor to the next command on a new line, but does not createy
orz
. In RStudio all three objects would be created, and this is what happens if you run the code directly in the console.The text was updated successfully, but these errors were encountered: