posit-dev / posit-dev/ark

Ark: Argument completions should not evaluate special bindings

Open
#984 0 comments 0 reactions 1 assignee View on GitHub

@lionel- is already working on this.

Since Feb 5, 2025.

Dominant language
Rust
Stars
337
Forks
32
Avg merge
8d 17h
Merged PRs (30d)
11

Description

For instance here: https://github.com/posit-dev/amalthea/blob/73d03d16/crates/ark/src/lsp/completions/session.rs#L481. We take steps to avoid evaluating complex expressions but within functions simple symbols may trigger arbitrary computations via lazy evaluation.

Currently low priority but will become more important when completions within the debugger are supported (#1871). This causes a timeout panic if the freeze lasts for more than 5 seconds, so this should definitely be fixed at some point.

Reprex:

# Simulate an argument that takes a long time when forced
delayedAssign("foo", Sys.sleep(10))

# Requesting argument completions freezes R and the LSP
foo(<CURSOR>)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.