Merged
Conversation
4ce0000 to
c90c9e2
Compare
This was referenced Feb 6, 2026
Closed
9c93a00 to
d86a261
Compare
There was a problem hiding this comment.
Pull request overview
This PR expands the R language server’s LSP feature set (type hierarchy + semantic tokens) and improves responsiveness by adding caching and moving several hot-path operations to C.
Changes:
- Implement
textDocument/prepareTypeHierarchy,typeHierarchy/supertypes, andtypeHierarchy/subtypeswith supporting class/member extraction. - Add
textDocument/semanticTokens/fulland/rangeplus server capability wiring. - Improve performance via parse/diagnostics caching, task scheduling tweaks, and new C implementations for token scanning, UTF-16/code-point conversion, semantic token encoding, and matching.
Reviewed changes
Copilot reviewed 43 out of 45 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/testthat/test-type-hierarchy.R | Adds type hierarchy tests (R6). |
| tests/testthat/test-symbol.R | Adapts symbol range assertions via helper. |
| tests/testthat/test-symbol-blocks.R | Tests symbols in top-level blocks. |
| tests/testthat/test-signature.R | Adds activeParameter test cases. |
| tests/testthat/test-semantic-tokens.R | Adds semantic tokens tests (full/range). |
| tests/testthat/test-lintr.R | Stabilizes lintr tests/config handling. |
| tests/testthat/test-hover.R | Makes hover tests less brittle. |
| tests/testthat/test-highlight-blocks.R | Tests highlights in top-level blocks. |
| tests/testthat/test-definition-blocks.R | Tests definition in top-level blocks. |
| tests/testthat/helper-utils.R | Adds request helpers + tweaks test server startup. |
| src/token.h | Declares C token scanner. |
| src/token.c | Implements fast token scanning in C. |
| src/semantic.h | Declares semantic token encoder. |
| src/semantic.c | Implements semantic token delta encoding in C. |
| src/match.h | Declares C matching helpers. |
| src/match.c | Implements ASCII case-insensitive/fuzzy matching. |
| src/encoding.h | Declares UTF-16/code-point conversion helpers. |
| src/encoding.c | Implements UTF-16/code-point conversion in C. |
| src/languageserver.c | Registers new .Call entry points. |
| README.md | Marks new LSP features as implemented. |
| R/workspace.R | Adds parse/diagnostics caches + cache cleanup. |
| R/utils.R | Adds ASCII detection, C-backed match/fuzzy, C token scan wrapper, and C-backed UTF-16 conversions. |
| R/type_hierarchy.R | Implements type hierarchy logic and class member extraction. |
| R/task.R | Adjusts task scheduling/utilization for parse tasks. |
| R/symbol.R | Adds hierarchical DocumentSymbol support + class member children. |
| R/signature.R | Adds activeParameter computation and parameter range parsing. |
| R/settings.R | Introduces diagnostics cache TTL setting. |
| R/semantic.R | Adds semantic tokens extraction + encoding + handlers. |
| R/selection.R | Formatting/indentation adjustments only. |
| R/rename.R | Formatting/indentation adjustments only. |
| R/references.R | Refactors reference collection to avoid repeated c() growth. |
| R/languageserver.R | Rescales session pool sizes and adds pending reply queues for new requests. |
| R/interfaces.R | Adds document_symbol() constructor for hierarchical symbols. |
| R/hover.R | Updates XPath roots to include more node types. |
| R/handlers-textsync.R | Parses immediately on open (delay=0). |
| R/handlers-langfeatures.R | Adds handlers for type hierarchy + semantic tokens requests. |
| R/formatting.R | Avoids repeated list growth when building edits. |
| R/document.R | Fixes srcref propagation for block parsing + adds parse caching by content hash. |
| R/diagnostics.R | Adds diagnostics caching + explicit linters fallback logic. |
| R/definition.R | Updates XPath roots similarly to hover/signature. |
| R/completion.R | Avoids repeated list growth + updates XPath roots. |
| R/code_action.R | Avoids repeated list growth when collecting actions. |
| R/capabilities.R | Advertises type hierarchy + semantic tokens capabilities. |
| NAMESPACE | Imports digest::digest. |
| DESCRIPTION | Adds digest dependency + updates RoxygenNote. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Update covarege
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements the following handlers:
and makes the following improvements:
activeParametersincompletionis supported.hierarchicalDocumentSymbolSupportis implemented so that class members are displayed in outline.{}with or withoutifwhileetc) have correct ranges.arg_value_completionso that completion items for the arg values in function likefun(arg = c("value1", "value2", etc))are supported.P.S: The code written in this PR is mostly done by @copilot.