Improvements re: completing function as reference vs call
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 337
- Forks
- 32
- Avg merge
- 8d 17h
- Merged PRs (30d)
- 11
Description
I think the last rounds of improvement re: function completions were in #819 and #754. For now, the heuristic for deciding whether to treat as a function reference vs. call is based on whether we're inside a list of special functions:
Two examples of sites where a user wants a function reference (but gets parentheses anyway) came up in https://github.com/posit-dev/positron/issues/9044#issuecomment-3734419418
library(tidyverse)
penguins |> relocate(where(is.character()))
map(1:3, mean())
The current list only contains functions from the base and utils packages. But tidyselect::where() is a pretty clearcut case. More complicated, but also compelling is purrr::map() (and base equivalents). Not sure which will come first: improving the ad hoc list or improving the whole approach, but opening this as a place to track concrete examples that folks mention.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read crates/ark/src/lsp/completions/function_context.rs around lines 158-166, then compare the existing special-function heuristic with the tidyselect::where() and purrr::map() examples in the issue. Review the referenced issues for context and determine whether the work should extend the list or replace the approach; done criteria are not specified beyond improving function-reference versus call completion behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r, rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100