Skip to content

Tweak settings#1235

Merged
renkun-ken merged 2 commits intomasterfrom
add-viewer-opts
Oct 26, 2022
Merged

Tweak settings#1235
renkun-ken merged 2 commits intomasterfrom
add-viewer-opts

Conversation

@ElianHugh
Copy link
Collaborator

  • Add vsc.dev.args setting
  • Add enum descriptions to r.source.focus
  • Minor stylistic changes to item descriptions

- Add vsc.dev.args setting
- Add enum descriptions to r.source.focus
- Minor stylistic changes
R/session/vsc.R Outdated
vsc.object_timeout = session$objectTimeout,
vsc.globalenv = session$watchGlobalEnvironment,
vsc.plot = setting(session$viewers$viewColumn$plot, Disable = FALSE),
vsc.dev.args = c(width = plot$devArgs$width, height = plot$devArgs$height),
Copy link
Member

@renkun-ken renkun-ken Oct 24, 2022

Choose a reason for hiding this comment

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

The option is used as following:

dev_args <- getOption("vsc.dev.args")
do.call(png, c(list(filename = plot_file), dev_args))

Maybe it makes more sense to just keep it as a list and not just limited to width and height.

"default": 1200
}
},
"additionalProperties": false
Copy link
Member

Choose a reason for hiding this comment

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

Maybe more arguments could be allowed here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, seeing how it leads to a call to png, that's a good point. If we remove the restriction, the settings UI will fallback to the "edit in JSON" dialog. I'm not sure if that's ideal? I think there's an argument to be made that if dots is required, people can use the R option. Alternatively, we could have '...' dots as an item for passing further args

Copy link
Member

Choose a reason for hiding this comment

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

I think this one is good enough. Let's revisit if somebody complains.

- Keep  devArgs as a list
- Width + height defaults set to 480
- Add some more options to devArgs

Pending discussion on args + settings UI
Copy link
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

@renkun-ken renkun-ken merged commit ec8b214 into master Oct 26, 2022
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.

2 participants