Skip to content

Commit ec8b214

Browse files
authored
Tweak settings (#1235)
* Tweak settings - Add vsc.dev.args setting - Add enum descriptions to r.source.focus - Minor stylistic changes * Review changes - Keep devArgs as a list - Width + height defaults set to 480 - Add some more options to devArgs Pending discussion on args + settings UI
1 parent 9736157 commit ec8b214

2 files changed

Lines changed: 53 additions & 14 deletions

File tree

R/session/vsc.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ load_settings <- function() {
2828
vsc.object_timeout = session$objectTimeout,
2929
vsc.globalenv = session$watchGlobalEnvironment,
3030
vsc.plot = setting(session$viewers$viewColumn$plot, Disable = FALSE),
31+
vsc.dev.args = plot$devArgs,
3132
vsc.browser = setting(session$viewers$viewColumn$browser, Disable = FALSE),
3233
vsc.viewer = setting(session$viewers$viewColumn$viewer, Disable = FALSE),
3334
vsc.page_viewer = setting(session$viewers$viewColumn$pageViewer, Disable = FALSE),

package.json

Lines changed: 52 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,32 +1287,32 @@
12871287
"r.rpath.windows": {
12881288
"type": "string",
12891289
"default": "",
1290-
"description": "Path to an R executable for Windows. Must be \"vanilla\" R, not radian etc.!"
1290+
"description": "Path to an R executable to launch R background processes (Windows). Must be \"vanilla\" R, not radian etc.!"
12911291
},
12921292
"r.rpath.mac": {
12931293
"type": "string",
12941294
"default": "",
1295-
"description": "Path to an R executable for macOS. Must be \"vanilla\" R, not radian etc.!"
1295+
"description": "Path to an R executable to launch R background processes (macOS). Must be \"vanilla\" R, not radian etc.!"
12961296
},
12971297
"r.rpath.linux": {
12981298
"type": "string",
12991299
"default": "",
1300-
"description": "Path to an R executable for Linux. Must be \"vanilla\" R, not radian etc.!"
1300+
"description": "Path to an R executable to launch R background processes (Linux). Must be \"vanilla\" R, not radian etc.!"
13011301
},
13021302
"r.rterm.windows": {
13031303
"type": "string",
13041304
"default": "",
1305-
"description": "R path for Windows. Can also be radian etc."
1305+
"description": "R path for interactive terminals (Windows). Can also be radian etc."
13061306
},
13071307
"r.rterm.mac": {
13081308
"type": "string",
13091309
"default": "",
1310-
"description": "R path for macOS. Can also be radian etc."
1310+
"description": "R path for interactive terminals (macOS). Can also be radian etc."
13111311
},
13121312
"r.rterm.linux": {
13131313
"type": "string",
13141314
"default": "",
1315-
"description": "R path for Linux. Can also be radian etc."
1315+
"description": "R path for interactive terminals (Linux). Can also be radian etc."
13161316
},
13171317
"r.rterm.option": {
13181318
"type": "array",
@@ -1397,7 +1397,7 @@
13971397
"r.rmarkdown.enableCodeLens": {
13981398
"type": "boolean",
13991399
"default": true,
1400-
"description": "Enable RMarkdown CodeLens, which are inline commands/buttons e.g. 'Run Chunk | Run Above' shown on the first line of each code chunk.\n\n- Click the buttons to run commands.\n- Hover on the buttons to show tooltips.\n- CodeLens commands are customizable via settings UI (Rmarkdown: Code Lens commands) or settings.json `r.rmarkdown.codeLensCommands`"
1400+
"markdownDescription": "Enable RMarkdown CodeLens, which are inline commands/buttons e.g. 'Run Chunk | Run Above' shown on the first line of each code chunk.\n\n- Click the buttons to run commands.\n- Hover on the buttons to show tooltips.\n- CodeLens commands are customizable via `#r.rmarkdown.codeLensCommands#` or settings.json `r.rmarkdown.codeLensCommands`"
14011401
},
14021402
"r.rmarkdown.chunkBackgroundColor": {
14031403
"type": "string",
@@ -1533,7 +1533,7 @@
15331533
"r.source.encoding": {
15341534
"type": "string",
15351535
"default": "UTF-8",
1536-
"description": "An optional encoding to pass to R when executing the file, i.e. 'source(FILE, encoding=ENCODING)'."
1536+
"markdownDescription": "An optional encoding to pass to R when executing the file, i.e. `source(FILE, encoding=ENCODING)`."
15371537
},
15381538
"r.source.focus": {
15391539
"type": "string",
@@ -1543,7 +1543,12 @@
15431543
"terminal",
15441544
"none"
15451545
],
1546-
"description": "What to show/focus after running code. Set to 'editor' or 'terminal' to show the terminal. Set to 'none' to not show the terminal."
1546+
"enumDescriptions": [
1547+
"Focus editor when sending code to terminal",
1548+
"Focus terminal when sending code to terminal",
1549+
"Do not show terminal when sending code to terminal"
1550+
],
1551+
"description": "What to show/focus after sending code to terminal."
15471552
},
15481553
"r.alwaysUseActiveTerminal": {
15491554
"type": "boolean",
@@ -1687,7 +1692,7 @@
16871692
},
16881693
"view": {
16891694
"type": "string",
1690-
"description": "Which view column to show the WebView triggered by View()? \n\nChanges the option 'vsc.plot' in R.",
1695+
"description": "Which view column to show the WebView triggered by View()? \n\nChanges the option 'vsc.view' in R.",
16911696
"enum": [
16921697
"Two",
16931698
"Active",
@@ -1725,7 +1730,7 @@
17251730
"r.rtermSendDelay": {
17261731
"type": "integer",
17271732
"default": 8,
1728-
"description": "Delay in milliseconds before sending each line to rterm (only applies if r.bracketedPaste is false)"
1733+
"markdownDescription": "Delay in milliseconds before sending each line to rterm. Requires `#r.bracketedPaste#` to be `false`."
17291734
},
17301735
"r.workspaceViewer.showObjectSize": {
17311736
"type": "boolean",
@@ -1745,7 +1750,7 @@
17451750
"r.liveShare.timeout": {
17461751
"type": "integer",
17471752
"default": 10000,
1748-
"description": "Time in milliseconds before aborting attempt to connect to Live Share API"
1753+
"description": "Time in milliseconds before aborting attempt to connect to Live Share API."
17491754
},
17501755
"r.liveShare.defaults.commandForward": {
17511756
"type": "boolean",
@@ -1762,6 +1767,39 @@
17621767
"default": false,
17631768
"description": "Default boolean value for automatically sharing R browser ports with guests."
17641769
},
1770+
"r.plot.devArgs" :{
1771+
"type": "object",
1772+
"markdownDescription": "The arguments for the png device to replay user graphics to show in VSCode. Requires `#r.plot.useHttpgd#` to be set to `false`. \n\nChanges the option `vsc.dev.args` in R.",
1773+
"default": {
1774+
"width": 800,
1775+
"height": 1200
1776+
},
1777+
"properties": {
1778+
"width": {
1779+
"type": "number",
1780+
"description": "Width of the graphic device.",
1781+
"default": 480
1782+
},
1783+
"height": {
1784+
"type": "number",
1785+
"description": "Height of the graphic device.",
1786+
"default": 480
1787+
},
1788+
"units": {
1789+
"type": "string",
1790+
"default": "px"
1791+
},
1792+
"pointsize": {
1793+
"type": "number",
1794+
"default": 12
1795+
},
1796+
"bg": {
1797+
"type": "string",
1798+
"default": "white"
1799+
}
1800+
},
1801+
"additionalProperties": false
1802+
},
17651803
"r.plot.useHttpgd": {
17661804
"type": "boolean",
17671805
"default": false,
@@ -1778,7 +1816,7 @@
17781816
"Match background and primary stroke color to the current color theme (Or apply custom CSS overwrites, if specified in `#r.plot.customStyleOverwrites#`)",
17791817
"Use original colors"
17801818
],
1781-
"markdownDescription": "Which color theme to use when launching the plot viewer."
1819+
"markdownDescription": "Which color theme to use when launching the httpgd plot viewer."
17821820
},
17831821
"r.plot.defaults.plotPreviewLayout": {
17841822
"type": "string",
@@ -1798,7 +1836,7 @@
17981836
"r.plot.defaults.fullWindowMode": {
17991837
"type": "boolean",
18001838
"default": false,
1801-
"markdownDescription": "Whether to use full window mode when launching the plot viewer."
1839+
"markdownDescription": "Whether to use full window mode when launching the httpgd plot viewer."
18021840
},
18031841
"r.plot.timing.resizeInterval": {
18041842
"type": "number",

0 commit comments

Comments
 (0)