withfig / fig

Public issue tracker for Fig.
https://fig.io
MIT License
2.06k stars 58 forks source link

Bash or zsh function are not listed in autocomplete #2728

Open JasCodes opened 11 months ago

JasCodes commented 11 months ago

Checks

Operating system

macOS 14.0.0 (23A339)

Expected behaviour

bash or zsh function should list in autocomplete

Actual behaviour

it's not listing in autocomplete

Steps to reproduce

No response

Environment

fig-details:
  - 2.16.0
hardware-info:
  - model: 
  - model-id: 
  - chip-id: Apple M1 Max
  - cores: 10
  - mem: 32.00 GB
os-info:
  - macOS 14.0.0 (23A339)
environment:
  - shell: /bin/zsh
  - terminal: alacritty
  - cwd: /Users/jascodes
  - exe-path: /opt/homebrew/bin/fig
  - install-method: unknown
  - env-vars:
    - DISPLAY: /private/tmp/com.apple.launchd.3UebaA9qO9/org.xquartz:0
    - FIGTERM_SESSION_ID: b687a117-84e5-45bc-8da8-2746d3b5e6f1
    - FIG_SET_PARENT_CHECK: 1
    - FIG_TERM: 2.16.0
    - PATH: /Users/jascodes/.local/share/fig/plugins/tsm_RobertAudi/dist/bin:/Users/jascodes/.local/share/fig/plugins/git-open:/Users/jascodes/.rd/bin:/Users/jascodes/.bun/bin:/Users/jascodes/.orbstack/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/usr/local/MacGPG2/bin:~/.dotnet/tools:/Users/jascodes/.fig/bin:/Users/jascodes/.local/bin:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home:/usr/local/opt/openjdk@11/bin:/Users/jascodes/.deno/bin:/Users/jascodes/.dotnet/tools:/usr/local/bin:/Users/jascodes/go/bin:/Users/jascodes/.pub-cache/bin:/Users/jascodes/fvm/default/bin:/Users/jascodes/Library/Android/sdk:/Users/jascodes/Library/Android/sdk/platform-tools:/Users/jascodes/.cargo/bin:/Users/jascodes/.node/node_modules/.bin:/Users/jascodes/.pip/.venv/bin:/Users/jascodes/.zsh/completions:/Users/jascodes/.local/share/fig/plugins/ugit_Bhupesh-V
    - SHELL: /bin/zsh
    - TERM: alacritty
    - __CFBundleIdentifier: org.alacritty
    - FIG_PID: 18478
    - FIG_SET_PARENT: b687a117-84e5-45bc-8da8-2746d3b5e6f1
mschrage commented 11 months ago

This is not currently supported but is definitely possible. How would you imagine it working, since normally Fig autocomplete doesn't appear until you've typed at least one command?

JasCodes commented 11 months ago

@mschrage

c(){
    if [ -z $1 ]; then
        code -r .
    else
        code -r $1
    fi
}

take this function for example. when i press c something else come up. I guess how ever you are caching list to command in path, this function should go in that list.

Frankly, I am suprise this didn't come up earlier.