Remove command Run Selection/Line in Active Terminal#409
Merged
andycraig merged 7 commits intoREditorSupport:masterfrom Sep 16, 2020
Merged
Remove command Run Selection/Line in Active Terminal#409andycraig merged 7 commits intoREditorSupport:masterfrom
andycraig merged 7 commits intoREditorSupport:masterfrom
Conversation
Replace with runTextInTerm().
Collaborator
Author
|
Thank you CI! I'd missed a couple of uses of |
Member
|
Thanks for the work! I'll do some testing soon. |
Member
|
I've tested all above items and everything works nicely. Please feel free to merge if nothing is to be added. |
Collaborator
Author
|
@renkun-ken Thank you for testing and reviewing! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #306
What problem did you solve?
This PR makes two changes:
R: Run Selection/Line in Active Terminal. Current behaviour of this command is to show a window stating that the command is being removed.R: Run Selection/Line in Active Terminalto always choose the active terminal. Since that command is being removed, the code that chooses the terminal can be moved further down the sequence of function calls. Making this change means thatrunTextInTerm()andchooseTerminalAndSendText()do the same thing, althoughchooseTerminalAndSendText()works for only one line of code, so I removedchooseTerminalAndSendText().How can I check this pull request?
Run Selection/Line in Active Terminaldoes NOT exist. (E.g., Ctrl+Shift+P, type 'Run Selection/Line in Active Terminal', confirm there is no such command.)This PR involves code paths from many commands. It should not change the behaviour of any of them. Here is how to test they still work.
Add the following to
keybindings.json:[ { "key": "ctrl+1", "command": "r.runCommand", "when": "editorTextFocus", "args": "TEST runCommand" }, { "key": "ctrl+2", "command": "r.runCommandWithSelectionOrWord", "when": "editorTextFocus", "args": "TEST runCommandWithSelectionOrWord $$" }, { "key": "ctrl+3", "command": "r.runCommandWithEditorPath", "when": "editorTextFocus", "args": "TEST runCommandWithEditorPath $$" } ]Make a directory
r-testcontaining a filetemp.R, with this content:Place cursor on word 'hello'.
I recommend doing the below once with setting
r.alwaysUseActiveTerminalenabled and once with it disabled.R: Run Source. Confirmsource([file path])is sent to terminal.R: Knit Rmd. Confirm file is knitted in terminal.R: Run Selection/Line. Confirmprint("hello world")is sent to terminal.R: Run Selection/Line (Retain Cursor). Confirmprint("hello world")is sent to terminal.R: Show length for a selected object. Confirmlength(hello)is sent to terminal. (It's not a variable so it will cause an error - that's fine.)TEST runCommandis sent to terminal. (It's not valid R code so it will cause an error - that's fine.)TEST runCommandWithSelectionOrWord hellois sent to terminal. (It's not valid R code so it will cause an error - that's fine.)TEST runCommandWithEditorPath [file path]is sent to terminal. (It's not valid R code so it will cause an error - that's fine.)R: Run from Beginning to Line. Confirm1is sent to terminal.R: Load All. Confirmdevtools::load_all()is sent to terminal. (It will cause an error - that's fine.)R: Test Package. Confirmdevtools::test()is sent to terminal. (It will cause an error - that's fine.)R: Install Package. Confirmdevtools::install()is sent to terminal. (It will cause an error - that's fine.)R: Build Package. Confirmdevtools::build()is sent to terminal. (It will cause an error - that's fine.)R: Document. Confirmdevtools::document()is sent to terminal. (It will cause an error - that's fine.)R: Attach Active Terminal. Confirm.vsc.attach()is sent to terminal.R: Preview Environment. Confirm something starting withwrite.csvis sent to the terminal. (This command is buggy so it might produce an error.)R: Preview Dataframe. Confirm something starting withwrite.csvis sent to the terminal. (hellois not a variable, so it might produce an error because of that, or it might produce a different error because it the command is buggy.)