Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.1.0 #13

Merged
merged 5 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
Package: box.lsp
Title: Provides box-compatibility for languageserver
Version: 0.0.0.9006
Authors@R:
Title: Provides 'box' Compatibility for 'languageserver'
Version: 0.1.0
Authors@R:
c(
person("Ricardo Rodrigo", "Basa", role = c("aut", "cre"), email = "[email protected]"),
person("Pavel", "Demin", role = "aut", email = "[email protected]"),
person("Jakub", "Nowicki", role = "aut", email = "[email protected]"),
person("Appsilon Sp. z o.o.", role = "cph", email = "[email protected]")
)
Description: A box-compatible custom language parser for the languageserver package to provide
completion and signature hints. Box is a package for modularized code. Languageserver is an
editor client helper for editor features such as auto completion.
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
License: LGPL (>= 3)
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
Imports:
Imports:
box,
cli,
fs,
Expand Down
33 changes: 2 additions & 31 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,3 @@
# box.lsp 0.0.0.9006
# box.lsp 0.1.0

* quality of life chores

# box.lsp 0.0.0.9005

* adds support for modules
* add aliases for both packages and modules

# box.lsp 0.0.0.9004

* add function signatures

# box.lsp 0.0.0.9003

* steps towards package

# box.lsp 0.0.0.9002

* support for pkg[attach_list]
* support for pkg[alias = attached_function]

# box.lsp 0.0.0.9001

* Added Pavel Demin's initial work.
* Added first unit test for pkg[...]
* Added languageserver test helper utilities

# box.lsp 0.0.0.9000

* Added a `NEWS.md` file to track changes to the package.
* Initialize repo
First release.
21 changes: 20 additions & 1 deletion R/box_lsp.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,33 @@ 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{
#' 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)
#' }
#'
#' @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
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ The code is based on initial work by [Pavel Demin](https://github.com/Gotfrid).

| `box::use()` | Code completion | Param completion | Tooltip help | As of version | Notes |
|---------------------------|:-:|:-:|:-:|--------:|:-:|
| `pkg[...]` | &check; | &check; | &check; | 0.0.0.9001 | Full support |
| `pkg[attach_list]` | &check; | &check; | &check; | 0.0.0.9004 | Link to documentation |
| `pkg[...]` | &check; | &check; | &check; | 0.1.0 | Full support |
| `pkg[attach_list]` | &check; | &check; | &check; | 0.1.0 | Link to documentation |
| `pkg` | | | | | |
| `prefix/mod[...]` | &check; | &check; | &check; | 0.0.0.9005 | No documentation |
| `prefix/mod[attach_list]` | &check; | &check; | &check; | 0.0.0.9005 | No documentation |
| `prefix/mod[...]` | &check; | &check; | &check; | 0.1.0 | No documentation |
| `prefix/mod[attach_list]` | &check; | &check; | &check; | 0.1.0 | No documentation |
| `prefix/mod` | | | | | |
| `alias = pkg` | | | | | |
| `alias = prefix/mod` | | | | | |
| `pkg[alias = fun]` | &check; | &check; | &check; | 0.0.0.9005 | No documentation |
| `prefix/mod[alias = fun]` | &check; | &check; | &check; | 0.0.0.9005 | No documentation |
| `pkg[alias = fun]` | &check; | &check; | &check; | 0.1.0 | No documentation |
| `prefix/mod[alias = fun]` | &check; | &check; | &check; | 0.1.0 | No documentation |

![](./man/figures/box.lsp_in_action.gif)

Expand Down Expand Up @@ -97,7 +97,7 @@ client <- TCPLanguageClient$new(host = "localhost", port = 8888)

#### On Instance B with `{languageserver}` package repo open

Copy
Copy

```R
source(".Rprofile") # custom parsers, custom lsp config
Expand Down
22 changes: 21 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.