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 |
Custom {languageserver} parser hook for {box} modules.
box_use_parser(expr, action)
box_use_parser(expr, action)
expr |
An R expression to evaluate |
action |
A list of action functions from |
Used for side-effects provided by the action
list of functions.
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)
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}
use_box_lsp(file_path = ".Rprofile")
use_box_lsp(file_path = ".Rprofile")
file_path |
File name to append |
Writes configuration lines to file_path
.
if (interactive()) { use_box_lsp() }
if (interactive()) { use_box_lsp() }