zsh-completions icon indicating copy to clipboard operation
zsh-completions copied to clipboard

Flutter completion not working

Open bartekpacia opened this issue 1 year ago • 2 comments

Since I mainly work with Flutter these days, I'm happy to see that this repo contains completions for both dart and flutter. However I'm unable to get the latter one to work on my machine – i.e. it uses the default behavior of listing files in my $PWD instead of printing commands and options of flutter tool. I'll gladly accept any help and explanation!

Debugging

I tried using tips from this SO answer.

Running dart <(Ctrl+X ?)> prints:

whereas flutter <(Ctrl+X ?)> prints:

Screenshot 2023-12-07 at 4 59 12 PM

So something's definitely off.

scr1

Environment

$ uname -a
Darwin Barteks-MacBook.local 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct  9 21:28:12 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T8103 arm64
$ zsh --version
zsh 5.9 (arm-apple-darwin21.3.0)
$ echo $FPATH | tr ':' '\n'
/Users/bartek/.oh-my-zsh/plugins/swiftpm
/Users/bartek/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
/Users/bartek/.oh-my-zsh/custom/plugins/zsh-autosuggestions
/Users/bartek/.oh-my-zsh/plugins/pod
/Users/bartek/.oh-my-zsh/plugins/macos
/Users/bartek/.oh-my-zsh/plugins/gradle
/Users/bartek/.oh-my-zsh/plugins/fzf
/Users/bartek/.oh-my-zsh/plugins/brew
/Users/bartek/.oh-my-zsh/plugins/adb
/Users/bartek/.oh-my-zsh/plugins/1password
/Users/bartek/.oh-my-zsh/functions
/Users/bartek/.oh-my-zsh/completions
/Users/bartek/.oh-my-zsh/cache/completions
/Users/bartek/.oh-my-zsh/custom/plugins/zsh-completions/src
/opt/homebrew/share/zsh/site-functions
/usr/local/share/zsh/site-functions
/usr/share/zsh/site-functions
/usr/share/zsh/5.9/functions
/opt/homebrew/share/zsh/site-functions
$ ls -1 ~/.oh-my-zsh/custom/plugins/zsh-completions/src | grep -E 'dart|flutter'
_dart
_flutter

bartekpacia avatar Dec 07 '23 16:12 bartekpacia

I can't reproduce your issue. Do other completions work on your platform ?

a

syohex avatar Dec 10 '23 02:12 syohex

Now I tried and neither dart nor flutter completions work. go also doesn't work FWIW, but some other completions do work, for example 1password (op command), adb, swiftpm and gradle.

zshrc
plugins=(
	1password
	adb
	brew
	# docker - works automatically when brew-installed
	# dotnet
	`#fzf` $([ -x "$(command -v fzf)" ] && echo 'fzf')
	flutter
	gradle
	macos
	pod
	zsh-autosuggestions
	zsh-syntax-highlighting
	swiftpm
)

if command -v brew >/dev/null 2>&1; then
	# Set up completions for `brew` command and `brew`-installed programs
	# See: https://docs.brew.sh/Shell-Completion#configuring-completions-in-zsh
	FPATH="$(brew --prefix)/share/zsh/site-functions:$FPATH"
fi

if [ -d "$ZSH" ]; then
	source "$ZSH/oh-my-zsh.sh"
	# oh-my-zsh initializes completion, so shrc needs to be sourced before it.
	# oh-my-zsh sets aliases, so aliases needs to be sourced after it.
fi

What could be the cause? I know I'm likely asking for a lot, but I'll greatly appreciate any tips. Thank you.

bartekpacia avatar Dec 11 '23 00:12 bartekpacia

Some months ago I made a hard reset of my mac and this problem's gone. So I guess the cause will never be identified.

If anyone's curious how my setup looks like now, see my dotfiles repo: https://github.com/bartekpacia/dotfiles

bartekpacia avatar Mar 11 '24 15:03 bartekpacia