REditorSupport / REditorSupport/languageserver

Feature Request: Option to hide S3 methods from completions

Open
#569 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
675
Forks
118
Avg merge
1d 37m
Merged PRs (30d)
11

Description

I often find that S3 methods can clutter the completions list, and think it would be helpful to be able to hide S3 methods in most cases.

For example, given a completion token, pri, completions look like:

With all of the print.* methods listed, it's hard to find any non-print functions.

Instead, it would be nice if these methods were hidden until a root of the token is an S3 generic. With the token pri, it could produce:

Methods are then included in the completions list once the . is added to denote a dispatch type. Once the . in print. is written, methods are included:

I implemented this behavior in a branch on my fork (though it's not exposed as an option right now), and would be happy to contribute it if you think it fits the project.

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start by comparing the current completion behavior with the implementation in the dgkf-hide-s3-method-completions branch. Expose the behavior as an option, keeping S3 methods hidden for ordinary tokens and including them after an S3 generic root such as print. is entered. Verify both completion cases before considering the work done.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.