File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11## uv Repository
22
33* [ astral-sh/uv] ( https://github.com/astral-sh/uv )
4-
5- ## Fix Autocompletion with feature Shells
6-
7- > [ !IMPORTANT]
8- > When installing a shell via another feature, make sure to override the installation order to ensure the generated autocompletion writes to existing files.
9-
10- ### Autocompletion for Fish Shell
11-
12- ``` json
13- "features" : {
14- "ghcr.io/meaningful-ooo/devcontainer-features/fish:latest" : {},
15- "ghcr.io/va-h/devcontainers-features/uv:latest" : {
16- "shellautocompletion" : true
17- }
18- },
19- "overrideFeatureInstallOrder" : [
20- " ghcr.io/meaningful-ooo/devcontainer-features/fish" ,
21- " ghcr.io/va-h/devcontainers-features/uv:latest"
22- ]
23- ```
Original file line number Diff line number Diff line change @@ -156,19 +156,9 @@ uv --version
156156
157157enable_autocompletion () {
158158 command=$1
159- if [ -f " $_REMOTE_USER_HOME /.bashrc" ]; then
160- echo " eval \"\$ (${command} bash)\" " >> $_REMOTE_USER_HOME /.bashrc
161- fi
162- if [ -f " $_REMOTE_USER_HOME /.zshrc" ]; then
163- echo " eval \"\$ (${command} zsh)\" " >> $_REMOTE_USER_HOME /.zshrc
164- fi
165- if [ -d " $_REMOTE_USER_HOME /.config/fish" ]; then
166- mkdir -p $_REMOTE_USER_HOME /.config/fish/completions
167- ${command} fish >> $_REMOTE_USER_HOME /.config/fish/completions/uv.fish
168- fi
169- if [ -f " $_REMOTE_USER_HOME /.elvish/rc.elv" ]; then
170- echo " eval (${command} elvish | slurp)" >> $_REMOTE_USER_HOME /.elvish/rc.elv
171- fi
159+ ${command} bash >> /usr/share/bash-completion/completions/uv
160+ ${command} zsh >> /usr/share/zsh/vendor-completions/_uv
161+ ${command} fish >> /usr/share/fish/completions/uv.fish
172162}
173163
174164if [ " $AUTOCOMPLETION " = " true" ]; then
Original file line number Diff line number Diff line change 88 }
99 },
1010 "uv-autocomplete" : {
11- "image" : " mcr.microsoft.com/devcontainers/base:ubuntu " ,
11+ "image" : " mcr.microsoft.com/devcontainers/base:debian " ,
1212 "features" : {
1313 "ghcr.io/devcontainers/features/common-utils:2.5.2" : {
1414 "installZsh" : true ,
Original file line number Diff line number Diff line change @@ -9,8 +9,9 @@ source dev-container-features-test-lib
99
1010# Feature-specific tests
1111# The 'check' command comes from the dev-container-features-test-lib.
12- check " uv autocomplete bash" cat ~ /.bashrc | grep " eval \"\$ (uv" | grep bash
13- check " uv autocomplete zsh" cat ~ /.zshrc | grep " eval \"\$ (uv" | grep zsh
12+ check " uv autocomplete bash" [ -e /usr/share/bash-completion/completions/uv ]
13+ check " uv autocomplete zsh" [ -e /usr/share/zsh/vendor-completions/_uv ]
14+ check " uv autocomplete fish" [ -e /usr/share/fish/completions/uv.fish ]
1415
1516# Report results
1617# If any of the checks above exited with a non-zero exit code, the test will fail.
You can’t perform that action at this time.
0 commit comments