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

Move generated completions to cache directory #10464

Merged
merged 1 commit into from Apr 27, 2024

Conversation

Accurate0
Copy link
Contributor

@Accurate0 Accurate0 commented Apr 27, 2024

Description

Generates completions in XDG_CACHE_HOME or ~/.cache by default and loads them from there.

Not sure what we want to about existing generated completions? This PR basically updates the paths and ignores the old ones, not sure if this change is considered breaking in that way...

Fixes #10369

TODOs:

  • Changes to fish usage are reflected in user documentation/manpages.
  • Tests have been added for regressions fixed
  • User-visible changes noted in CHANGELOG.rst

src/env/environment.rs Outdated Show resolved Hide resolved
share/functions/__fish_config_interactive.fish Outdated Show resolved Hide resolved
@krobelus
Copy link
Member

The breakage in ninja -Cbuild test_expansion.fish is

Testing file checks/expansion.fish ... Failure:

  The CHECKERR on line 316 wants:
    fish: Expected a variable name after this $.

  which failed to match line stderr:22:
    rmdir: failed to remove '/tmp/tmp.fTr6tzPmvD/temp/tmp.tPB4txOGmK/realhome': Directory not empty

which means that we should teach our test framework to set XDG_CACHE_HOME similar to how it already sets XDG_CONFIG_HOME and others. This way the "realhome" will be empty

@krobelus
Copy link
Member

tests/test_env.sh:44:1:XDG_CONFIG_HOME="$homedir/xdg_config_home"
tests/test_env.sh:45:8:export XDG_CONFIG_HOME
tests/test_env.sh:46:11:mkdir -p $XDG_CONFIG_HOME/fish || die

need to add it in this file

@Accurate0
Copy link
Contributor Author

tests/test_env.sh:44:1:XDG_CONFIG_HOME="$homedir/xdg_config_home"
tests/test_env.sh:45:8:export XDG_CONFIG_HOME
tests/test_env.sh:46:11:mkdir -p $XDG_CONFIG_HOME/fish || die

need to add it in this file

ah great thank you, I was trying get my head around how the testing was setup, makes sense now.

is there any test that makes sense to add or amend? I didn't see anything existing that seemed to relate

@krobelus
Copy link
Member

We don't have tests for this yet. Would be good but not absolutely necessary

@krobelus krobelus added this to the fish next-3.x milestone Apr 27, 2024
@krobelus krobelus merged commit 62a8b48 into fish-shell:master Apr 27, 2024
5 of 7 checks passed
@Accurate0 Accurate0 deleted the move-generated-completions branch April 27, 2024 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Store generated_completions in ~/.cache/fish not ~/.local/share/fish
2 participants