Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
ff3c074
Add semantic token support
renkun-ken Feb 5, 2026
1c3245f
Update desc
renkun-ken Feb 5, 2026
79c0c18
Fix test
renkun-ken Feb 5, 2026
19ee868
Support activeParameter
renkun-ken Feb 5, 2026
b628bcb
Support named parameter
renkun-ken Feb 5, 2026
56a0ccf
Fix for dots
renkun-ken Feb 5, 2026
3043978
Fix semantic-token request queueing
renkun-ken Feb 5, 2026
06fee41
Update task handling
renkun-ken Feb 5, 2026
79ddd73
Fix semantic tokens sync
renkun-ken Feb 6, 2026
3cb96f1
Implement type hierarchy
renkun-ken Feb 6, 2026
10aed98
Update README
renkun-ken Feb 6, 2026
c0a4887
Initial fix
renkun-ken Feb 6, 2026
4b4e2fe
Fix document parse
renkun-ken Feb 6, 2026
a35167b
Support class members for document symbols
renkun-ken Feb 6, 2026
c90c9e2
Fix detecting class members
renkun-ken Feb 6, 2026
576effa
Update references_reply
renkun-ken Feb 11, 2026
f701dac
Reformat rename
renkun-ken Feb 11, 2026
2184866
Reformat
renkun-ken Feb 11, 2026
d4e1999
Add parse_cache and diagnostics_cache
renkun-ken Feb 12, 2026
ad3cc39
Rewrite some semantic in C
renkun-ken Feb 13, 2026
cc6d34d
Implement encoding
renkun-ken Feb 13, 2026
b70113b
Update implement token in C
renkun-ken Feb 13, 2026
d49665e
Update token
renkun-ken Feb 13, 2026
0399010
Fix token
renkun-ken Feb 13, 2026
53655de
Implement match in C
renkun-ken Feb 13, 2026
d054d21
Update semantic
renkun-ken Feb 13, 2026
cae1148
Pre-allocate lists
renkun-ken Feb 14, 2026
d86a261
Fix token detection
renkun-ken Feb 14, 2026
78008d2
Fix tests
renkun-ken Feb 19, 2026
d460a79
Fix issues
renkun-ken Feb 19, 2026
72a0c4c
Update semantic
renkun-ken Feb 19, 2026
6ede77d
Fix semantic
renkun-ken Feb 19, 2026
ee438bc
Add arg_value_completion
renkun-ken Feb 19, 2026
e4c7973
Fix test cases
renkun-ken Feb 19, 2026
2db93e9
Update tests
renkun-ken Feb 19, 2026
dcf38c7
Update completion
renkun-ken Feb 20, 2026
780e9f9
Update completion
renkun-ken Feb 20, 2026
28c47be
Fix completion
renkun-ken Feb 20, 2026
06a471d
Fix completion
renkun-ken Feb 20, 2026
2142574
Fix test-completion
renkun-ken Feb 20, 2026
c61bf0f
Fix test-completion
renkun-ken Feb 20, 2026
ab9d2c1
Fix test-completion
renkun-ken Feb 20, 2026
b64703a
Fix test-completion
renkun-ken Feb 20, 2026
4158264
Fix completion
renkun-ken Feb 20, 2026
dd78a12
Update .lintr
renkun-ken Feb 20, 2026
217d7e1
Add sleep to test did_open
renkun-ken Feb 20, 2026
2152d81
Update date
renkun-ken Feb 20, 2026
d61db45
Update covarege
renkun-ken Feb 20, 2026
b61e01e
Merge pull request #713 from REditorSupport/update-covarge
renkun-ken Feb 20, 2026
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
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ man-roxygen
^.lintr$
^CRAN-SUBMISSION$
^\.devcontainer$
^\.github$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
110 changes: 47 additions & 63 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,86 +1,70 @@
name: Coverage

# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches:
- master
branches: [main, master]
pull_request:
branches:
- master
branches: [main, master]

jobs:
cleanup:
name: Cancel Previous Runs
runs-on: ubuntu-latest
steps:
- uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
name: Coverage

permissions: read-all

codecov:
jobs:
test-coverage:
if: contains(github.event.head_commit.message, '[ci skip]') == false
name: codecov ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# - os: ubuntu-latest
# log_file: /tmp/languageserver/ubuntu-log
- os: macos-latest
log_file: /tmp/languageserver/macos-log
# - os: windows-latest
# log_file: C:/tmp/languageserver/windows-log
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
NOT_CRAN: true
_R_CHECK_CRAN_INCOMING_: false
R_LANGSVR_LOG: ${{ matrix.log_file }}
R_LANGSVR_POOL_SIZE: 1
R_LANGSVR_TEST_FAST: NO

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
r-version: release
- name: Create log directory on Linux or macOS
if: runner.os != 'Windows'
run: mkdir -p $(dirname ${{ env.R_LANGSVR_LOG }})
- name: Create log directory on Windows
if: runner.os == 'Windows'
run: New-Item -ItemType directory -Path (Split-Path -Parent ${{ env.R_LANGSVR_LOG }})
- name: Query dependencies

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr, any::xml2
needs: coverage

- name: Test coverage
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
print(cov)
covr::to_cobertura(cov)
shell: Rscript {0}
- name: Restore R package cache
uses: actions/cache@v4

- uses: codecov/codecov-action@v5
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
- name: Install system dependencies
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
- name: Install dependencies
run: |
Rscript -e "remotes::install_deps(dependencies = TRUE)"
Rscript -e "remotes::install_cran('covr')"
- name: Install a sperate copy on Windows
if: runner.os == 'Windows'
# Fail if error if not on PR, or if on PR and token is given
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
files: ./cobertura.xml
plugins: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Show testthat output
if: always()
run: |
Rscript -e "remotes::install_local()"
- name: Codecov
run: Rscript -e "covr::codecov()"
env:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
- uses: actions/upload-artifact@v4
## --------------------------------------------------------------------
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-log
path: ${{ env.R_LANGSVR_LOG }}
name: coverage-test-failures
path: ${{ runner.temp }}/package
2 changes: 2 additions & 0 deletions .lintr
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ linters: linters_with_defaults(
object_name_linter = NULL,
commented_code_linter = NULL,
cyclocomp_linter = NULL,
pipe_consistency_linter = NULL,
trailing_whitespace_linter = NULL,
indentation_linter(indent = 4, hanging_indent_style = "never"))
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Type: Package
Package: languageserver
Title: Language Server Protocol
Version: 0.3.16.9001
Date: 2023-08-17
Date: 2026-02-20
Authors@R:
c(person(given = "Randy",
family = "Lai",
Expand All @@ -23,6 +23,7 @@ Depends:
Imports:
callr (>= 3.0.0),
collections (>= 0.3.0),
digest,
fs (>= 1.3.1),
jsonlite (>= 1.6),
lintr (>= 3.0.0),
Expand All @@ -49,6 +50,6 @@ ByteCompile: yes
Encoding: UTF-8
NeedsCompilation: yes
Roxygen: list(markdown = TRUE, r6 = FALSE)
RoxygenNote: 7.2.1
RoxygenNote: 7.3.3
Config/testthat/edition: 3
Config/Needs/development: testthat, magrittr, mockery, purrr, withr, rmarkdown
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ export(run)
import(callr)
import(xml2)
importFrom(R6,R6Class)
importFrom(digest,digest)
importFrom(parallel,detectCores)
useDynLib(languageserver)
22 changes: 20 additions & 2 deletions R/capabilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,23 @@ ExecuteCommandOptions <- list(
commands = NULL
)

SemanticTokensOptions <- list(
legend = list(
tokenTypes = c(
"namespace", "type", "class", "enum", "interface", "struct",
"typeParameter", "parameter", "variable", "property", "enumMember",
"event", "function", "method", "macro", "keyword", "modifier",
"comment", "string", "number", "regexp", "operator", "decorator"
),
tokenModifiers = c(
"declaration", "definition", "readonly", "static", "deprecated",
"abstract", "async", "modification", "documentation", "defaultLibrary"
)
),
full = TRUE,
range = TRUE
)

ServerCapabilities <- list(
textDocumentSync = TextDocumentSyncOptions,
hoverProvider = TRUE,
Expand All @@ -68,9 +85,10 @@ ServerCapabilities <- list(
colorProvider = TRUE,
foldingRangeProvider = TRUE,
selectionRangeProvider = TRUE,
callHierarchyProvider = TRUE
callHierarchyProvider = TRUE,
typeHierarchyProvider = TRUE,
semanticTokensProvider = SemanticTokensOptions
# linkedEditingRangeProvider = FALSE,
# semanticTokensProvider = FALSE,
# monikerProvider = FALSE,
# executeCommandProvider = ExecuteCommandOptions,
# workspace = list()
Expand Down
15 changes: 12 additions & 3 deletions R/code_action.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ CodeActionKind <- list(
#'
#' @keywords internal
document_code_action_reply <- function(id, uri, workspace, document, range, context) {
result <- list()
result <- vector("list", length(context$diagnostics) * 2)
idx <- 0L
listed_linters <- character()

for (item in context$diagnostics) {
Expand Down Expand Up @@ -72,7 +73,8 @@ document_code_action_reply <- function(id, uri, workspace, document, range, cont
)
)

result <- c(result, list(action))
idx <- idx + 1L
result[[idx]] <- action
listed_linters <- c(listed_linters, "*")
}

Expand Down Expand Up @@ -113,12 +115,19 @@ document_code_action_reply <- function(id, uri, workspace, document, range, cont
)
)

result <- c(result, list(action))
idx <- idx + 1L
result[[idx]] <- action
listed_linters <- c(listed_linters, item$code)
}
}
}

if (idx == 0L) {
result <- list()
} else if (idx < length(result)) {
result <- result[seq_len(idx)]
}

logger$info("document_code_action_reply: ", list(
uri = uri,
range = range,
Expand Down
Loading
Loading