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

WIP: Interactive R tasks #1267

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ManuelHentschel
Copy link
Member

WIP/Proof of concept. Addresses #1239, #1242.

Makes R tasks interactive by running the specified code from a custom .Rprofile. This feels a bit hacky, but was the only way I managed to make R run code specified in the task description, and still read interactive responses from stdin.

Sourcing the original .Rprofile from within the modified one should be possible (is done for the extension's R terminals anyways I think). Not sure what the other drawbacks of this approach are. Since most tasks are not supposed to be interactive, I would probably add this as an optional mechanism, to be enabled in the task definition. To test, define e.g. the following task:

{
  "tasks": [
    {
      "type": "R",
      "code": [
        "print('hello world')",
        "s <- readline()",
        "print(s)"
      ],
      "group": "build",
      "problemMatcher": [],
      "label": "R: Build"
    }
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant