Package 'box.lsp'

Title: Provides 'box' Compatibility for 'languageserver'
Description: A 'box' compatible custom language parser for the 'languageserver' package to provide completion and signature hints in code editors.
Authors: Ricardo Rodrigo Basa [aut, cre], Pavel Demin [aut], Jakub Nowicki [aut], Appsilon Sp. z o.o. [cph]
Maintainer: Ricardo Rodrigo Basa <[email protected]>
License: LGPL-3
Version: 0.1.3
Built: 2024-12-31 07:38:22 UTC
Source: CRAN

Help Index


'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()
}