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

Do not contribute "r.sourceCurrentFile" affordances in an R package #4567

Merged
merged 2 commits into from
Sep 4, 2024

Conversation

juliasilge
Copy link
Contributor

@juliasilge juliasilge commented Sep 3, 2024

Addresses #1359

I can't think of good reasons why people would in fact want any of these affordances in an R package. Even without them, you can still do something like Cmd+Enter to get a function defined, as well as of course the better/recommended options like devtools::load_all(), etc.

QA Notes

After this change,

  • when you are in an .R file but not in an R package, you get the command to source your current file on the editor action bar, in the context menu, and via the keybinding.
  • when you are in an R package in an .R file, you do not see this command in any of these three spots.

I kept the command in the command palette because it is used in testing (the testing workspaces look like R packages) and it's not super prominent for users there.

Copy link
Collaborator

@jmcphers jmcphers left a comment

Choose a reason for hiding this comment

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

I think this makes sense for R files that are in the R package, but I'm somewhat concerned people will expect to have this affordance for other R scripts in the workspace (scratch files, utility scripts, etc.) Let's see how it feels.

@juliasilge
Copy link
Contributor Author

For future work, we could make a new context key that applies only to files in the /R directory in an R package and use that instead.

I do think it's likely having the console and Cmd+Enter gets us where we need to be for how most users approach their scratch/iterative work.

@juliasilge juliasilge merged commit 08986c1 into main Sep 4, 2024
2 checks passed
@juliasilge juliasilge deleted the no-sourcing-in-r-pkg branch September 4, 2024 15:38
@github-actions github-actions bot locked and limited conversation to collaborators Sep 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants