check_scope: check if a token is in a R code block in an Rmarkdown file
Description
In an RMarkdown document, tokens can be either inside an R code block or
in the text. This function will return FALSE
if the token is in the text
and TRUE
if it is in a code block. For R scripts, it always returns TRUE
.
Usage
check_scope(uri, document, position)
Arguments
uri
a character, the path to a file as defined by RFC 3986
document
a character, the contents of the document