Skip to content

Deno completions not working in VSCode #12581

Description

@devsheva

Describe the bug

I correctly installed deno plugin in .zshrc file with antigen, but it doesn't load completions within VSCode.

Steps to reproduce

  1. Enable deno plugin
  2. Try completions on VSCode

Expected behavior

It should load completions as it does in Warp.

Screenshots and recordings

Screenshot 2024-07-27 at 14 01 26

OS / Linux distribution

macOS Sonoma 14.5

Zsh version

5.9

Terminal emulator

Warp

If using WSL on Windows, which version of WSL

None

Additional context

No response

Activity

  1. mcornella commented on Jul 27, 2024

    @mcornella
    Member

    This is probably related to this #10581 (comment)

    i.e. that antigen does not run the init script from Oh My Zsh, so it's probable that $ZSH_CACHE_DIR does not exist or is undefined, and/or that $ZSH_CACHE_DIR/completions is not created.

    Try

    echo $ZSH_CACHE_DIR 

    It should return something like /path/to/oh-my-zsh-folder/cache or $HOME/.cache/oh-my-zsh.
    If not, set ZSH_CACHE_DIR="$HOME/.cache/oh-my-zsh" in your .zshrc file, before antigen loads stuff.

    Then, also check

    ls -l "$ZSH_CACHE_DIR"
    ls -l "$ZSH_CACHE_DIR/completions"

    If this doesn't exist, run mkdir -p $ZSH_CACHE_DIR/completions.

    Finally, you should check whether this directory is added to $fpath:

    print -l $fpath

    $ZSH_CACHE_DIR/completions should be one of the lines. If not, you should also add the directory to $fpath in your .zshrc file, before Oh My Zsh or its plugins are loaded. Full reference to add to .zshrc file in [1].

    After that everything should work again.

    [1]

    # put this before Oh My Zsh or its plugins are loaded
    ZSH_CACHE_DIR="$HOME/.cache/oh-my-zsh"
    mkdir -p "$ZSH_CACHE_DIR/completions"
    fpath=("$ZSH_CACHE_DIR/completions" $fpath)
  2. moved this from Backlog to Done in Main projecton Jul 27, 2024
  3. added
    Area: pluginIssue or PR related to a plugin
    Topic: completionPull Request or issue regarding completion
    Topic: plugin managerIssue or PR related to plugin managers (antigen, zplug, zgen, zpm, ...)
    on Jul 27, 2024
  4. mcornella commented on Jul 27, 2024

    @mcornella
    Member
  5. devsheva commented on Jul 27, 2024

    @devsheva
    Author

    I have all set though, and it still doesn't work in VSCode integrated terminal, Terminal.app of macOS, but works with Warp. I think last one works cause it has a builtin intellisense system

    ❯ echo $ZSH_CACHE_DIR
    /Users/mateo/.antigen/bundles/robbyrussell/oh-my-zsh/cache/
    
    ❯ ls -l "$ZSH_CACHE_DIR"
    ❯ ls -l "$ZSH_CACHE_DIR/completions"
    total 8
    drwxr-xr-x  3 mateo  staff   96 Jul  8 22:56 completions
    -rw-r--r--  1 mateo  staff  251 Jul 27 00:49 grep-alias
    total 208
    -rw-r--r--@ 1 mateo  staff  103458 Jul 27 13:58 _deno
    
    
  6. mcornella commented on Jul 27, 2024

    @mcornella
    Member

    OK, then it must be a $PATH issue: deno needs to be in $PATH when the deno plugin is loaded, try adding checks [1] before and after plugin is loaded to confirm.

    [1]

    which -a deno
  7. devsheva commented on Jul 27, 2024

    @devsheva
    Author

    This is the output of

    source ~/.zshrc

    
    Seems robbyrussell/oh-my-zsh is already installed!
    Seems robbyrussell/oh-my-zsh is already installed!
    Seems zsh-users/zsh-syntax-highlighting is already installed!
    Seems zsh-users/zsh-autosuggestions is already installed!
    Seems zsh-users/zsh-completions is already installed!
    Seems robbyrussell/oh-my-zsh is already installed!
    Seems robbyrussell/oh-my-zsh is already installed!
    /Users/mateo/.asdf/shims/deno
    Seems robbyrussell/oh-my-zsh is already installed!
    /Users/mateo/.asdf/shims/deno
    

    This is my .zshrc config

    source $HOME/antigen.zsh
        
    # Load the oh-my-zsh's library
    antigen use oh-my-zsh
    
    antigen bundles <<EOBUNDLES
        # Bundles from the default repo (robbyrussell's oh-my-zsh)
        git
    
        # Syntax highlighting bundle.
        zsh-users/zsh-syntax-highlighting
    
        # Fish-like auto suggestions
        zsh-users/zsh-autosuggestions
    
        # Extra zsh completions
        zsh-users/zsh-completions
    
        # Enable asdf
        asdf
    
    EOBUNDLES
    
    # Load the theme
    antigen theme robbyrussell
    
    which -a deno
    antigen bundle deno
    
    antigen apply
    
    alias dev="cd ~/develop"
    
    which -a deno
    eval "$(starship init zsh)"
    
    
  8. moved this from Done to Backlog in Main projecton Jul 27, 2024
  9. mcornella commented on Jul 27, 2024

    @mcornella
    Member

    OK, is $ZSH_CACHE_DIR/completions in $fpath?

  10. devsheva commented on Jul 27, 2024

    @devsheva
    Author

    seems not, if this is the right way to check it

    ❯ echo $fpath | grep $ZSH_CACHE_DIR/completions
    
    hn-telegram-bot on  feature/analyze-articles [!] via 🦕 v1.45.4 
    ❯ echo $fpath                                  
    /usr/local/share/zsh/site-functions /usr/share/zsh/site-functions /usr/share/zsh/5.9/functions /Users/mateo/.antigen/bundles/robbyrussell/oh-my-zsh/lib /Users/mateo/.antigen/bundles/robbyrussell/oh-my-zsh/plugins/git /Users/mateo/.antigen/bundles/zsh-users/zsh-syntax-highlighting /Users/mateo/.antigen/bundles/zsh-users/zsh-autosuggestions /Users/mateo/.antigen/bundles/zsh-users/zsh-completions /Users/mateo/.antigen/bundles/robbyrussell/oh-my-zsh/plugins/asdf /Users/mateo/.antigen/bundles/robbyrussell/oh-my-zsh/plugins/deno /Users/mateo/.antigen/bundles/zsh-users/zsh-completions/src /Users/mateo/.asdf/completions
    
    
  11. devsheva commented on Jul 27, 2024

    @devsheva
    Author

    the strange thing is that aliases are working, so at least the plugin script is executed

  12. mcornella commented on Jul 27, 2024

    @mcornella
    Member

    OK that explains it, so you also need to add it to $fpath, I'm going to update the instructions.

    Full setup in .zshrc would be this:

    # put this before Oh My Zsh or its plugins are loaded
    ZSH_CACHE_DIR="$HOME/.cache/oh-my-zsh"
    mkdir -p "$ZSH_CACHE_DIR/completions"
    fpath=("$ZSH_CACHE_DIR/completions" $fpath)
  13. moved this from Backlog to Done in Main projecton Jul 27, 2024
  14. devsheva commented on Jul 27, 2024

    @devsheva
    Author

    this worked out, but shouldn't it be done by the plugin itself? would make sense to add it i guess

  15. mcornella commented on Jul 27, 2024

    @mcornella
    Member

    The idea in #12853 is to make it easier for plugin managers to run the requirements for Oh My Zsh plugins.

    There are quite a few of those for OMZ plugins and it wouldn't be clean to include it for all the plugins that need it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: pluginIssue or PR related to a pluginResolution: not our issueIssue or pull request not related to Oh My ZshTopic: completionPull Request or issue regarding completionTopic: plugin managerIssue or PR related to plugin managers (antigen, zplug, zgen, zpm, ...)

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions