Skip to content

Commit

Permalink
docs: Add function examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubnowicki committed Aug 20, 2024
1 parent cce38c9 commit 34f9074
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
7 changes: 6 additions & 1 deletion R/box_lsp.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,19 @@ process_module <- function(sym_name, signature, action) {
action$parse(func_sig[[3L]])
}

#' Box::use Document Parser
#' 'box::use' Document Parser
#'
#' Custom \{languageserver\} parser hook for \{box\} modules.
#'
#' @param expr An R expression to evaluate
#' @param action A list of action functions from `languageserver:::parse_expr()`.
#' @returns Used for side-effects provided by the `action` list of functions.
#'
#' @examples
#' \dontrun{
#' box_use_parser(expr = expression(box::use(fs)), action = new.env())
#' }
#'
#' @export
box_use_parser <- function(expr, action) {
call <- match.call(box::use, expr)
Expand Down
5 changes: 5 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
#' @param file_path File name to append `{box.lsp}` configuration lines.
#' @returns Writes configuration lines to `file_path`.
#'
#' @examples
#' \dontrun{
#' use_box_lsp()
#' }
#'
#' @export
use_box_lsp <- function(file_path = ".Rprofile") {
rprofile <- fs::path_package("box.lsp", "Rprofile.R")
Expand Down
8 changes: 7 additions & 1 deletion man/box_use_parser.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions man/use_box_lsp.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 34f9074

Please sign in to comment.