From 99584a0db2d74f288ef2c90614dfa4db35d1d187 Mon Sep 17 00:00:00 2001 From: Randy Lai Date: Thu, 13 Oct 2022 11:02:19 -0700 Subject: [PATCH 1/6] bump to v0.3.14 --- DESCRIPTION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 30f2034d..c8863627 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: languageserver Title: Language Server Protocol -Version: 0.3.13 -Date: 2022-05-22 +Version: 0.3.14 +Date: 2022-10-13 Authors@R: c(person(given = "Randy", family = "Lai", From 433a20c18ac6c207cdf91dcb65240fc4e2e1bd0c Mon Sep 17 00:00:00 2001 From: Randy Lai Date: Thu, 13 Oct 2022 11:06:06 -0700 Subject: [PATCH 2/6] Update NEWS.MD --- NEWS.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/NEWS.md b/NEWS.md index 87882e3d..df101f66 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,26 @@ +# languageserver 0.3.14 + +**Closed issues:** + +- NA introduced into position when opening curly braces (#564) +- `html-to-markdown.lua` error: attempt to call a nil value (#555) +- R6Class finalize() method is public, but it should be private as of R6 2.4.0 (#551) + +**Merged pull requests:** + +- Drop diagnostics on callback if disabled (#577) +- Bump styfle/cancel-workflow-action from 0.10.1 to 0.11.0 (#576) +- Bump styfle/cancel-workflow-action from 0.10.0 to 0.10.1 (#573) +- Provide package symbols before lint in diagnostics (#568) +- Support completion item labelDetails (#571) +- Enable multiple-level fold section of R document like RStudio (#566) +- fix NA introduced into position (#565) +- Requires lintr 3.0.0 (#562) +- Bump styfle/cancel-workflow-action from 0.9.1 to 0.10.0 (#560) +- Use lua-filter when pandoc_version >= 2.11 (#556) +- Update link to the lintr package (#554) +- Use private finalizers for R6 classes (#553) + # languageserver 0.3.13 **Closed issues:** From b8d6eaccd94823a293b2e0e037126232d3e7684f Mon Sep 17 00:00:00 2001 From: Randy Lai Date: Thu, 13 Oct 2022 11:22:51 -0700 Subject: [PATCH 3/6] =?UTF-8?q?fix=20"function=20declaration=20isn?= =?UTF-8?q?=E2=80=99t=20a=20prototype"=20warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/languageserver.c | 2 +- src/reader.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/languageserver.c b/src/languageserver.c index 26382ac6..4e27dce0 100644 --- a/src/languageserver.c +++ b/src/languageserver.c @@ -13,7 +13,7 @@ static int ppid = -1; -SEXP process_is_detached() { +SEXP process_is_detached(void) { if (ppid == -1) { ppid = (int) getppid(); } diff --git a/src/reader.h b/src/reader.h index 943a236d..20aaf551 100644 --- a/src/reader.h +++ b/src/reader.h @@ -7,6 +7,6 @@ SEXP stdin_read_char(SEXP _n); -SEXP stdin_read_line(); +SEXP stdin_read_line(void); #endif From 72d728157458c8718d90e61950c946954daf41f5 Mon Sep 17 00:00:00 2001 From: Randy Lai Date: Sat, 15 Oct 2022 10:36:16 -0700 Subject: [PATCH 4/6] Use with instead of attach --- R/diagnostics.R | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/R/diagnostics.R b/R/diagnostics.R index 1c3a8f3f..e13f7d30 100644 --- a/R/diagnostics.R +++ b/R/diagnostics.R @@ -85,12 +85,11 @@ diagnose_file <- function(uri, content, is_rmarkdown = FALSE, globals = NULL, ca } if (length(globals)) { - env_name <- "languageserver:globals" - attach(globals, name = env_name, warn.conflicts = FALSE) - on.exit(detach(env_name, character.only = TRUE)) + lints <- with(globals, lintr::lint(path, cache = cache, text = content)) + } else { + lints <- lintr::lint(path, cache = cache, text = content) } - lints <- lintr::lint(path, cache = cache, text = content) diagnostics <- lapply(lints, diagnostic_from_lint, content = content) names(diagnostics) <- NULL diagnostics From 6a56d748b341d4b4c16f8928318c7af581f1848e Mon Sep 17 00:00:00 2001 From: Randy Lai Date: Sat, 15 Oct 2022 11:22:44 -0700 Subject: [PATCH 5/6] Chanage the parent environment of "globals" --- R/diagnostics.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/diagnostics.R b/R/diagnostics.R index e13f7d30..034d64be 100644 --- a/R/diagnostics.R +++ b/R/diagnostics.R @@ -85,6 +85,7 @@ diagnose_file <- function(uri, content, is_rmarkdown = FALSE, globals = NULL, ca } if (length(globals)) { + parent.env(globals) <- environment() lints <- with(globals, lintr::lint(path, cache = cache, text = content)) } else { lints <- lintr::lint(path, cache = cache, text = content) From 8b27a18e780d5a2070bdd4a754cac092da468371 Mon Sep 17 00:00:00 2001 From: Kun Ren Date: Sun, 16 Oct 2022 10:57:29 +0800 Subject: [PATCH 6/6] Fix attach globals in diagnose_file --- R/diagnostics.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/R/diagnostics.R b/R/diagnostics.R index 034d64be..60b82a82 100644 --- a/R/diagnostics.R +++ b/R/diagnostics.R @@ -85,12 +85,12 @@ diagnose_file <- function(uri, content, is_rmarkdown = FALSE, globals = NULL, ca } if (length(globals)) { - parent.env(globals) <- environment() - lints <- with(globals, lintr::lint(path, cache = cache, text = content)) - } else { - lints <- lintr::lint(path, cache = cache, text = content) + env_name <- "languageserver:globals" + do.call("attach", list(globals, name = env_name, warn.conflicts = FALSE)) + on.exit(do.call("detach", list(env_name, character.only = TRUE))) } + lints <- lintr::lint(path, cache = cache, text = content) diagnostics <- lapply(lints, diagnostic_from_lint, content = content) names(diagnostics) <- NULL diagnostics