Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config option to enable or disable AUR completions #539

Closed
wants to merge 2 commits into from

Conversation

ipha
Copy link

@ipha ipha commented Jul 8, 2018

Personally, I find the initial delay when it's building the cache annoying and the extra clutter makes it harder to find the repo package I'm looking for. So let's add an option to disable it!

Two parts to this pull request:

  1. Split the cache file into separate aur and repo caches
  2. Add a config option to disable aur completions

ipha added 2 commits July 8, 2018 15:18
Cache files are split into aur_*.cache and repo_*.cache in preperation
for a new config option to disable AUR completion.
Adds the new confg option "completeaur" with corresponding cmd flags.
Defaults to 'true' to maintain existing behavior when not set.
@Morganamilo
Copy link
Contributor

Instead of a config option how about making the completion respect --aur/--repo? No idea how hard that is to implement though.

@ipha
Copy link
Author

ipha commented Jul 8, 2018

Could do that, but the config would just have to move to the completion scripts. Not quite sure how that should work, an env var maybe?

I could probably update zsh, but I'm not familiar with bash or fish completion.

@Jguer
Copy link
Owner

Jguer commented Jul 8, 2018

@ipha I wouldn't separate into 2 files. We already have a good file for repo, it's the database. We just add it to aur_fish.cache because it's convenient.
If there's an option to disable it makes far more sense to build the AUR completions on the go like pacman does.

To alleviate network side pains I propose the following:

  • Bump the update time from 48h to a user controlled value, I didn't add this option initially because I'm not such a fan of battering the AUR with requests.
  • When grabbing the AUR packages file (from network), use a very small timeout so we can ignore the AUR completion if it's taking too long.

If it's not network sided, I suppose you're using bash which is painfully slow when it comes to completions, that has no cure unfortunately.

@Morganamilo It's a pain on the completion side but doable and easy on the yay side. Making it respect that makes more sense

@Jguer
Copy link
Owner

Jguer commented Jul 8, 2018

So it's zsh, better but not perfect when it comes to large completion file indexing. This option if added only for the "clutter" aspect wouldn't need to be added for fish as it allows for this display:

yay -S 0a
0ad  (community)  0ad-data  (community)  0ad-data-git  (AUR)  0ad-git  (AUR)

@ipha
Copy link
Author

ipha commented Jul 9, 2018

Any sort of network action on completion will have a noticeable delay -- even with a short timeout.
Even with the (repo) tags, for my use-case, I never want aur completion.

How do propose I proceed if I want a feature that just turns off aur completions?

@Morganamilo
Copy link
Contributor

The way I see it, the point of Yay is to add AUR support, if you're only interested in repo packages whats wrong with pacman?

@TomaszGasior
Copy link

I agree with this issue. Autocompletion is delayed and the ability to disable AUR completion could be useful.

@Morganamilo Yes, AUR helpers are used to use AUR. But some people (me as an example) are using AUR-helper's command instead pacman for every case. So for example when I want to install package from Arch repo (I am sure it is placed in repo, no in AUR) I'm using yay -S [first letters][tab] instead sudo pacman -S [first letters][tab] — for consistency and convenience. And for this use case disabling AUR completion is good. Yes, I can use yay -S --repo [first letters][tab] but this is not convenient, it's incompatible with pacman. I want to use pacman switches with yay command.

@Morganamilo Morganamilo mentioned this pull request Jul 24, 2018
@Morganamilo
Copy link
Contributor

Morganamilo commented Jul 26, 2018

Hopefully #584 is good enough for you. The network delay should be gone at least. If not you canforce it away by setting --completioninterval -1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants