Skip to content

Comments

Fix uv completions on fish#8

Merged
va-h merged 4 commits intova-h:mainfrom
mmartinortiz:fix-uv-completions-on-fish
Feb 5, 2025
Merged

Fix uv completions on fish#8
va-h merged 4 commits intova-h:mainfrom
mmartinortiz:fix-uv-completions-on-fish

Conversation

@mmartinortiz
Copy link
Contributor

Hi,

I realised that the fix I submitted previously was actually not fixing anything. This time I've made some more testing to make sure it works. This is the .devcontainer.json used for my tests after making a local copy of the feature source code:

{
	"name": "Python",
	"image": "mcr.microsoft.com/devcontainers/python:1-3.13-bookworm",
	"features": {
		"ghcr.io/meaningful-ooo/devcontainer-features/fish:latest": {},
		"./uv": {
			"shellautocompletion": true
		}
	},
	"overrideFeatureInstallOrder": [
		"ghcr.io/meaningful-ooo/devcontainer-features/fish",
		"./uv"
	]
}

I added some debug traces with echo to install.sh and discovered that:

  1. Without overriding the installation order, the uv feature may be installed before fish, and then the auto completion config.fish check fails.
  2. The file config.fish does not exist even when fish shell has been installed before uv. However, the $HOME/.config/fish folder does exist.

The mkdir -p command is probably not necessary. During debugging the completions folder already existed, but I thought it would be a good "just in case".

The completions are saved into its own file, the fish documentation suggests that it helps to keep things tidy.

An alternative way to address the generation of the auto completion, would be to generate the completions for all the shells, and put them in a system wide location. In the case of fish, this could be /etc/fish/completions. Maybe other shells have a similar way to keep them.

As a side note, for debugging the builds of my .devcontainer.json I used the following commands (fish shell syntax):

# Change how build logs are shown in the terminal
> set -xU BUILDKIT_PROGRESS plain
# Build using the devcontainer-cli
> devcontainer build --workspace-folder (pwd) --log-level debug --no-cache

I'm quite new to the development of devcontainer's features and templates. If you have comments or suggestions about how to do things, the feedback is welcome :-)

@va-h
Copy link
Owner

va-h commented Feb 5, 2025

Hello Martin,

Please give me a day or two to think about this issue, unfortunately I don't have much time on my hands right now but I will look into it. As your pull request seems to fix things by docs alone I will merge this at home later. Thank you :)

@va-h va-h merged commit 0dcd185 into va-h:main Feb 5, 2025
9 checks passed
@mmartinortiz
Copy link
Contributor Author

Hello Martin,

Please give me a day or two to think about this issue, unfortunately I don't have much time on my hands right now but I will look into it. As your pull request seems to fix things by docs alone I will merge this at home later. Thank you :)

Hi Valentin,

No problem. Let me know if there is something I can do to help.

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.

2 participants