Skip to content

Add tasks Check, Document, Install, Test#603

Merged
andycraig merged 2 commits intoREditorSupport:masterfrom
andycraig:tasks
Apr 4, 2021
Merged

Add tasks Check, Document, Install, Test#603
andycraig merged 2 commits intoREditorSupport:masterfrom
andycraig:tasks

Conversation

@andycraig
Copy link
Copy Markdown
Collaborator

Relevant to #59

What problem did you solve?

Adds some Tasks (Document, Install, Test).

I'm hoping that having these in the code will encourage others to add tasks they think would be useful, since it should be pretty clear how these can be copy-pasted to add new tasks.

How can I check this pull request?

Run command Tasks: Run Task. Select R. Observe R: Document, R: Install, R: Check. Select one of them. Select Continue without scanning the task output. Observe that the Rscript command is sent to a new terminal. E.g., for R: Install, the following appears in the terminal:

Executing task: Rscript -e "devtools::install()"

@renkun-ken
Copy link
Copy Markdown
Member

Looks like R: Check is missing. Would you like to also add it?

@renkun-ken
Copy link
Copy Markdown
Member

renkun-ken commented Apr 4, 2021

When I choose to Tasks: Configure Tasks, the following appears in the task.json:

{
	"version": "2.0.0",
	"tasks": [
		{
			"type": "R",
			"problemMatcher": [],
			"label": "R: Document"
		}
	]
}

I don't see a way to customize the command or arguments like configuring other self-created tasks in the fields available for this task in the auto-completion just like presented in #59 (comment).

@andycraig andycraig changed the title Add tasks Document, Install, Test Add tasks Check, Document, Install, Test Apr 4, 2021
@andycraig
Copy link
Copy Markdown
Collaborator Author

Looks like R: Check is missing. Would you like to also add it?

Done.

@andycraig
Copy link
Copy Markdown
Collaborator Author

Re: Tasks: Configure Tasks, I've never used that command so I'm not 100% sure what the correct behaviour would be here. I ran Tasks: Configure Tasks and selected R: Install, then added a "presentation" field as shown below. When I tried running R: Install again, the Task - R: Install terminal did indeed stay in the background as expected. It appears that the tasks can be customised in this way. So, perhaps this is working okay already?

{
	"tasks": [
		{
			"type": "R",
			"problemMatcher": [],
			"label": "R: Install",
			"presentation": {
                                "reveal": "never"
                        }
		}
	]
}

@renkun-ken
Copy link
Copy Markdown
Member

Looks like the configuration is meant to customize other properties of the task except the command to run.

Copy link
Copy Markdown
Member

@renkun-ken renkun-ken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andycraig
Copy link
Copy Markdown
Collaborator Author

@renkun-ken Thanks for the review! I will merge.

@andycraig andycraig merged commit 17a7d69 into REditorSupport:master Apr 4, 2021
@ManuelHentschel
Copy link
Copy Markdown
Member

Would there be problems with using r.rpath.xxx for these tasks? From my experience, the normal R -e ... (rather than Rscript) works as well and the user would be able to configure the R path used to run the task.

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.

3 participants