Repository navigation
Deno completions not working in VSCode #12581
Description
Activity
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_DIRdoes not exist or is undefined, and/or that$ZSH_CACHE_DIR/completionsis not created.Try
echo $ZSH_CACHE_DIR
It should return something like
/path/to/oh-my-zsh-folder/cacheor$HOME/.cache/oh-my-zsh.
If not, setZSH_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/completionsshould be one of the lines. If not, you should also add the directory to$fpathin your .zshrc file, before Oh My Zsh or its plugins are loaded. Full reference to add to.zshrcfile 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)
- addedArea: pluginIssue or PR related to a pluginIssue or PR related to a pluginTopic: completionPull Request or issue regarding completionPull Request or issue regarding completionTopic: plugin managerIssue or PR related to plugin managers (antigen, zplug, zgen, zpm, ...)Issue or PR related to plugin managers (antigen, zplug, zgen, zpm, ...)Resolution: not our issueIssue or pull request not related to Oh My ZshIssue or pull request not related to Oh My Zsh
on Jul 27, 2024 Documented in the FAQ https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#completions-are-not-loaded-when-using-a-plugin-manager and opened #12583 to fix this common issue.
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 _denoOK, then it must be a
$PATHissue:denoneeds to be in$PATHwhen the deno plugin is loaded, try adding checks [1] before and after plugin is loaded to confirm.[1]
which -a deno
This is the output of
source ~/.zshrcSeems 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/denoThis is my
.zshrcconfigsource $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)"OK, is
$ZSH_CACHE_DIR/completionsin$fpath?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/completionsthe strange thing is that aliases are working, so at least the plugin script is executed
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)
this worked out, but shouldn't it be done by the plugin itself? would make sense to add it i guess
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.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Describe the bug
I correctly installed deno plugin in
.zshrcfile with antigen, but it doesn't load completions within VSCode.Steps to reproduce
Expected behavior
It should load completions as it does in Warp.
Screenshots and recordings
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