Title: Provides 'box' Compatibility for 'languageserver'
Version: 0.1.3
Description: A 'box' compatible custom language parser for the 'languageserver' package to provide completion and signature hints in code editors.
URL: https://github.com/Appsilon/box.lsp, https://appsilon.github.io/box.lsp/
BugReports: https://github.com/Appsilon/box.lsp/issues
License: LGPL-3
Encoding: UTF-8
RoxygenNote: 7.3.2
Imports: box, cli, fs, rlang
Suggests: languageserver, lintr, magrittr, mockery, purrr, rprojroot, stringi, stringr, testthat (≥ 3.0.0), withr
Config/testthat/edition: 3
NeedsCompilation: no
Packaged: 2024-09-19 07:33:10 UTC; kuba
Author: Ricardo Rodrigo Basa [aut, cre], Pavel Demin [aut], Jakub Nowicki [aut], Appsilon Sp. z o.o. [cph]
Maintainer: Ricardo Rodrigo Basa <opensource+rodrigo@appsilon.com>
Repository: CRAN
Date/Publication: 2024-09-19 14:20:02 UTC

'box::use' Document Parser

Description

Custom {languageserver} parser hook for {box} modules.

Usage

box_use_parser(expr, action)

Arguments

expr

An R expression to evaluate

action

A list of action functions from languageserver:::parse_expr().

Value

Used for side-effects provided by the action list of functions.

Examples


  action <- list(
   assign = function(symbol, value) {
     cat(paste("ASSIGN: ", symbol, value, "\n"))
   },
   update = function(packages) {
     cat(paste("Packages: ", packages, "\n"))
   },
   parse = function(x) {
     cat(paste("Parse: ", names(x), x, "\n"))
   },
   parse_args = function(x) {
     cat(paste("Parse Args: ", names(x), x, "\n"))
   }
 )
  box_use_parser(expr = expression(box::use(fs)), action = action)



Configures a project to use {box.lsp}

Description

Configures a project to use {box.lsp}

Usage

use_box_lsp(file_path = ".Rprofile")

Arguments

file_path

File name to append {box.lsp} configuration lines.

Value

Writes configuration lines to file_path.

Examples

if (interactive()) {
  use_box_lsp()
}