Title: | Support for Visual Studio Code Debugger |
---|---|
Description: | Provides support for a visual studio code debugger |
Authors: | Manuel Hentschel [aut, cre], Kun Ren [ctb], Denes Toth [ctb] |
Maintainer: | Manuel Hentschel <[email protected]> |
License: | MIT |
Version: | 0.5.3 |
Built: | 2024-12-05 10:26:42 UTC |
Source: | https://github.com/ManuelHentschel/vscDebugger |
(Partial) implementation of the Debug Adapter Protocol for R.
Provides support for the vscode extension vscode-R-Debugger.
Maintainer: Manuel Hentschel [email protected]
Other contributors:
Kun Ren [email protected] [contributor]
Denes Toth [email protected] (ORCID) [contributor]
Useful links:
Report bugs at https://github.com/ManuelHentschel/vscDebugger/issues
Get info about a variable by applying the relevant varInfo
entries.
.vsc.applyVarInfos( v, infos = character(0), stackingInfos = character(0), verbose = getOption("vsc.verboseVarInfos", FALSE), ind = NULL )
.vsc.applyVarInfos( v, infos = character(0), stackingInfos = character(0), verbose = getOption("vsc.verboseVarInfos", FALSE), ind = NULL )
v |
The variable, any R value. |
infos |
Character vector of field names in |
stackingInfos |
Character vector of field names in |
verbose |
Whether to print debug info using |
ind |
The indices to retrieve if child variables are retrieved. |
The allowed varInfo
entries and their types are:
childVars: MinimalVariable[]
nChildVars: number
customAttributes: MinmalVariable[]
internalAttributes: MinmalVariable[]
toString: string
type: string
evaluateName: string
printFunc: function | boolean
Where MinimalVariable[]
refers to a list of named lists with entries:
name: string
rValue: any R value
setter: (optional, undocumented)
setInfo: (optional, undocumented)
A named list, containing the corresponding varInfo
results.
varInfos
base::source
Modified version of base::source
that honors breakpoints set by the debugger.
.vsc.debugSource( file, local = FALSE, envir = NULL, chdir = FALSE, print.eval = NULL, encoding = "unknown", ... )
.vsc.debugSource( file, local = FALSE, envir = NULL, chdir = FALSE, print.eval = NULL, encoding = "unknown", ... )
file |
String giving the name of the file to be sourced. Connections etc. are not supported! |
local |
Same as in |
envir |
The environment in which to evaluate the sourced code. Overwrites |
chdir |
Whether to temporarily change the working directory to the location of |
encoding |
The encoding to be used by |
... |
Further arguments are ignored but allowed for compatibility with |
Other overwrites:
.vsc.load_all()
,
outputOverwrites
Tools to check the varInfos computed for variables and modify the list of varInfos used.
.vsc.getAllVarInfoFields(varInfos = session$varInfos) .vsc.applyAllVarInfos(v, verbose = TRUE) .vsc.resetVarInfos() .vsc.addVarInfo(varInfo, overwrite = FALSE) .vsc.removeVarInfos(positions) .vsc.getVarInfos(positions = NULL) .vsc.checkVarInfos(varInfos = session$varInfos)
.vsc.getAllVarInfoFields(varInfos = session$varInfos) .vsc.applyAllVarInfos(v, verbose = TRUE) .vsc.resetVarInfos() .vsc.addVarInfo(varInfo, overwrite = FALSE) .vsc.removeVarInfos(positions) .vsc.getVarInfos(positions = NULL) .vsc.checkVarInfos(varInfos = session$varInfos)
varInfos |
List of varInfos |
v |
Variable, any R object |
verbose |
passed to |
varInfo |
A varInfo, i.e. named list. |
overwrite |
Boolean, whether to overwrite the entry in that position |
positions |
Numeric or character vector, the entries to retrieve/remove |
pkgload::load_all()
Modified version of pkgload::load_all()
.vsc.load_all(...)
.vsc.load_all(...)
Other overwrites:
.vsc.debugSource()
,
outputOverwrites
Error handler used by vsc. Set with options(error = .vsc.onError)
.vsc.onError(err = NULL)
.vsc.onError(err = NULL)
err |
The message to be sent to vsc. Defaults to |
Refresh breakpoints known to the debugger
Can be used if breakpoints were invalidated by e.g. load_all()
or source()
.vsc.refreshBreakpoints(envs = NULL)
.vsc.refreshBreakpoints(envs = NULL)
Modified versions of core R functions that add debugger specific functionality.
With the default debug configuration, the normal R functions are overwritten with these
(using attach()
).
The modified functions are designed to be mostly interchangeable with their counterparts.
If the overwrites are not required, they can be toggled using the launch config entries
overwriteCat
, overwritePrint
, overwriteStr
, and overwriteMessage
.
.vsc.cat(..., skipCalls = 0, showSource = TRUE) .vsc.print(x, ..., skipCalls = 0, showSource = TRUE) .vsc.message( ..., domain = NULL, appendLF = TRUE, showSource = TRUE, skipCalls = 0 ) .vsc.str(object, ..., skipCalls = 0, showSource = TRUE)
.vsc.cat(..., skipCalls = 0, showSource = TRUE) .vsc.print(x, ..., skipCalls = 0, showSource = TRUE) .vsc.message( ..., domain = NULL, appendLF = TRUE, showSource = TRUE, skipCalls = 0 ) .vsc.str(object, ..., skipCalls = 0, showSource = TRUE)
... |
Further arguments that are passed to the original function |
skipCalls |
The number of calls to skip when reporting the calling file and line. Can be useful e.g. inside a log function. |
showSource |
Whether to show the calling source file and line |
x |
Same as in |
domain |
Same as in |
appendLF |
Same as in |
object |
Same as in |
These functions return the same value as the overwritten functions themselves.
Other overwrites:
.vsc.debugSource()
,
.vsc.load_all()