doom-nvim icon indicating copy to clipboard operation
doom-nvim copied to clipboard

[BUG] Disabling snippets throws error

Open baurmatt opened this issue 3 years ago • 5 comments

Current Behavior:

When disabling the snippets module, nvim throws the following error on startup:

packer.nvim: Error running config for LuaSnip: [string "..."]:0: module 'luasnip' not found:
^Ino field package.preload['luasnip']
^Ino file './luasnip.lua'
^Ino file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20220310/share/luajit-2.1.0-beta3/luasnip.lua'
^Ino file '/usr/local/share/lua/5.1/luasnip.lua'
^Ino file '/usr/local/share/lua/5.1/luasnip/init.lua'
^Ino file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20220310/share/lua/5.1/luasnip.lua'
^Ino file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20220310/share/lua/5.1/luasnip/init.lua'
^Ino file '/home/mbaur/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/luasnip.lua'
^Ino file '/home/mbaur/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/luasnip/init.lua'
^Ino file '/home/mbaur/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/luasnip.lua'
^Ino file '/home/mbaur/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/luasnip/init.lua'
^Ino file './luasnip.so'
^Ino file '/usr/local/lib/lua/5.1/luasnip.so'
^Ino file '/home/linuxbrew/.linuxbrew/Cellar/luajit-openresty/2.1-20220310/lib/lua/5.1/luasnip.so'
^Ino file '/usr/local/lib/lua/5.1/loadall.so'

Expected Behavior:

Please let me disable the snippets module :D

Steps To Reproduce:

Logs

Check Health Output

nvim: health#nvim#check

Configuration

  • OK: no issues found

Performance

  • OK: Build type: Release

Remote Plugins

  • OK: Up to date

terminal

  • INFO: key_backspace (kbs) terminfo entry: key_backspace=^H
  • INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  • INFO: $SSH_TTY='/dev/pts/0'

tmux

  • ERROR: escape-time (500) is higher than 300ms
    • ADVICE:
      • set escape-time in ~/.tmux.conf: set-option -sg escape-time 10
      • https://github.com/neovim/neovim/wiki/FAQ
  • INFO: Checking stuff
  • WARNING: focus-events is not enabled. |'autoread'| may not work.
    • ADVICE:
      • (tmux 1.9+ only) Set focus-events in ~/.tmux.conf: set-option -g focus-events on
  • INFO: $TERM: screen
  • ERROR: $TERM should be "screen-256color" or "tmux-256color" in tmux. Colors might look wrong.
    • ADVICE:
      • Set default-terminal in ~/.tmux.conf: set-option -g default-terminal "screen-256color"
      • https://github.com/neovim/neovim/wiki/FAQ
  • WARNING: Neither Tc nor RGB capability set. True colors are disabled. |'termguicolors'| won't work properly.
    • ADVICE:
      • Put this in your ~/.tmux.conf and replace XXX by your $TERM outside of tmux: set-option -sa terminal-overrides ',XXX:RGB'
      • For older tmux versions use this instead: set-option -ga terminal-overrides ',XXX:Tc'

nvim-lsp-installer: require("nvim-lsp-installer.health").check()

nvim-lsp-installer report

  • OK: neovim version >= 0.6.0
  • WARNING: Go: not available
  • WARNING: Composer: not available
  • WARNING: PHP: not available
  • WARNING: javac: not available
  • WARNING: java: not available
  • WARNING: julia: not available
  • OK: sh: Ok
  • OK: bash: GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)
  • OK: tar: tar (GNU tar) 1.30
  • OK: gzip: gzip 1.10
  • OK: wget: GNU Wget 1.20.3 built on linux-gnu.
  • OK: python3: Python 3.9.10
  • OK: Ruby: ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
  • OK: curl: curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3
  • OK: node: v17.7.1
  • OK: RubyGem: 3.1.4
  • OK: pip3: pip 21.3.1 from /home/mbaur/.linuxbrew/Cellar/[email protected]/3.9.10/lib/python3.9/site-packages/pip (python 3.9)
  • OK: npm: 8.5.2

nvim-treesitter: require("nvim-treesitter.health").check()

Installation

  • OK: tree-sitter found 0.20.6 (parser generator, only needed for :TSInstallFromGrammar)
  • OK: node found v17.7.1 (only needed for :TSInstallFromGrammar)
  • OK: git executable found.
  • OK: cc executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" } Version: cc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
  • OK: Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.

Parser/Features H L F I J

  • hcl ✓ . ✓ ✓ ✓
  • lua ✓ ✓ ✓ ✓ ✓
  • json ✓ ✓ ✓ ✓ .
  • yaml ✓ ✓ ✓ ✓ ✓
  • python ✓ ✓ ✓ ✓ ✓
  • norg ✓ . ✓ . ✓
  • dockerfile ✓ . . . ✓
  • toml ✓ ✓ ✓ ✓ ✓
  • bash ✓ ✓ ✓ . ✓
  • ruby ✓ ✓ ✓ ✓ ✓
  • go ✓ ✓ ✓ ✓ ✓

Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections +) multiple parsers found, only one will be used x) errors found in the query, try to run :TSUpdate {lang}

provider: health#provider#check

Clipboard (optional)

  • OK: Clipboard tool found: tmux

Python 2 provider (optional)

  • WARNING: No Python executable found that can import neovim. Using the first available executable for diagnostics.
  • ERROR: Python provider error:
    • ADVICE:
      • provider/pythonx: Could not load Python 2: python2 not found in search path or not executable. /usr/bin/python2.7 does not have the "neovim" module. :help |provider-python| python2.6 not found in search path or not executable. /opt/brtool/bin/python is Python 3.6 and cannot provide Python 2.
  • INFO: Executable: Not found

Python 3 provider (optional)

  • INFO: g:python3_host_prog is not set. Searching for python3.8 in the environment.
  • INFO: Multiple python3.8 executables found. Set g:python3_host_prog to avoid surprises.
  • INFO: Executable: /usr/bin/python3.8
  • INFO: Other python executable: /bin/python3.8
  • INFO: Other python executable: /opt/cr/bin/python3.8
  • INFO: Other python executable: /opt/instance_service_cli/bin/python3.8
  • INFO: Other python executable: /opt/ipmigrate/bin/python3.8
  • INFO: Python version: 3.8.10
  • INFO: pynvim version: 0.4.3
  • OK: Latest pynvim is installed.

Python virtualenv

  • OK: no $VIRTUAL_ENV

Ruby provider (optional)

  • INFO: Ruby: ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
  • WARNING: neovim-ruby-host not found.
    • ADVICE:
      • Run gem install neovim to ensure the neovim RubyGem is installed.
      • Run gem environment to ensure the gem bin directory is in $PATH.
      • If you are using rvm/rbenv/chruby, try "rehashing".
      • See :help |g:ruby_host_prog| for non-standard gem installations.

Node.js provider (optional)

  • INFO: Node.js: v17.7.1
  • WARNING: Missing "neovim" npm (or yarn) package.
    • ADVICE:
      • Run in shell: npm install -g neovim
      • Run in shell (if you use yarn): yarn global add neovim

Perl provider (optional)

  • ERROR: perl provider error:
    • ADVICE:
      • "Neovim::Ext" cpan module is not installed

vim.lsp: require("vim.lsp.health").check()

  • INFO: LSP log level : WARN
  • INFO: Log path: /home/mbaur/.cache/nvim/lsp.log
  • INFO: Log size: 164 KB

vim.treesitter: require("vim.treesitter.health").check()

  • INFO: Runtime ABI version : 14
  • OK: Loaded parser for bash: ABI version 13
  • OK: Loaded parser for dockerfile: ABI version 13
  • OK: Loaded parser for go: ABI version 13
  • OK: Loaded parser for hcl: ABI version 13
  • OK: Loaded parser for json: ABI version 13
  • OK: Loaded parser for lua: ABI version 13
  • OK: Loaded parser for norg: ABI version 13
  • OK: Loaded parser for python: ABI version 13
  • OK: Loaded parser for ruby: ABI version 13
  • OK: Loaded parser for toml: ABI version 13
  • OK: Loaded parser for yaml: ABI version 13

which_key: health#which_key#check

WhichKey: checking conflicting keymaps

  • WARNING: conflicting keymap exists for mode "n", lhs: "gc"
  • INFO: rhs: <Plug>kommentary_motion_default
Doom Report Output

Doom Nvim crash report

Report date: 2022-06-08 12:15:09

System and Doom Nvim information

  • OS: Ubuntu 20.04.4 LTS
  • Neovim version: 0.6.1
  • Doom Nvim information:
    • version: 3.3.0
    • doom_root variable: /home/mbaur/.config/nvim
    • doom_configs_root variable: /home/mbaur/.config/nvim

Begin error log dump

[ERROR Wed 08 Jun 2022 12:11:31 PM CEST] /home/mbaur/.config/nvim/lua/doom/core/functions/init.lua:356: Error while updating Doom. Traceback:
[ERROR Wed 08 Jun 2022 12:11:32 PM CEST] /home/mbaur/.config/nvim/lua/doom/core/functions/init.lua:356: Error while updating Doom. Traceback:
[ERROR Wed 08 Jun 2022 12:11:32 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-blankline' module
[ERROR Wed 08 Jun 2022 12:11:32 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-cmp' module
[ERROR Wed 08 Jun 2022 12:11:32 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-colorizer' module
[ERROR Wed 08 Jun 2022 12:11:32 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-format' module
[ERROR Wed 08 Jun 2022 12:11:32 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-lint' module
[ERROR Wed 08 Jun 2022 12:11:32 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-lsp-signature' module
[ERROR Wed 08 Jun 2022 12:11:32 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-todo' module
[ERROR Wed 08 Jun 2022 12:11:32 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-toggleterm' module
[ERROR Wed 08 Jun 2022 12:11:32 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-tree' module
[ERROR Wed 08 Jun 2022 12:11:32 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-trouble' module
[ERROR Wed 08 Jun 2022 12:11:32 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-zen' module
[ERROR Wed 08 Jun 2022 12:11:32 PM CEST] ....config/nvim/lua/doom/modules/built-in/compiler/init.lua:7: Doom compiler needs toggleterm plugin, please uncomment the 'terminal' entry in your doom_modules.lua
[ERROR Wed 08 Jun 2022 12:11:32 PM CEST] ...r/.config/nvim/lua/doom/modules/built-in/runner/init.lua:7: Doom runner needs toggleterm plugin, please uncomment the 'terminal' entry in your doom_modules.lua
[ERROR Wed 08 Jun 2022 12:11:33 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-blankline' module
[ERROR Wed 08 Jun 2022 12:11:33 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-cmp' module
[ERROR Wed 08 Jun 2022 12:11:33 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-colorizer' module
[ERROR Wed 08 Jun 2022 12:11:33 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-format' module
[ERROR Wed 08 Jun 2022 12:11:33 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-lint' module
[ERROR Wed 08 Jun 2022 12:11:33 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-lsp-signature' module
[ERROR Wed 08 Jun 2022 12:11:33 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-todo' module
[ERROR Wed 08 Jun 2022 12:11:33 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-toggleterm' module
[ERROR Wed 08 Jun 2022 12:11:33 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-tree' module
[ERROR Wed 08 Jun 2022 12:11:33 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-trouble' module
[ERROR Wed 08 Jun 2022 12:11:33 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-zen' module
[ERROR Wed 08 Jun 2022 12:11:33 PM CEST] ....config/nvim/lua/doom/modules/built-in/compiler/init.lua:7: Doom compiler needs toggleterm plugin, please uncomment the 'terminal' entry in your doom_modules.lua
[ERROR Wed 08 Jun 2022 12:11:33 PM CEST] ...r/.config/nvim/lua/doom/modules/built-in/runner/init.lua:7: Doom runner needs toggleterm plugin, please uncomment the 'terminal' entry in your doom_modules.lua
[ERROR Wed 08 Jun 2022 12:11:43 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-blankline' module
[ERROR Wed 08 Jun 2022 12:11:43 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-cmp' module
[ERROR Wed 08 Jun 2022 12:11:43 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-colorizer' module
[ERROR Wed 08 Jun 2022 12:11:43 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-format' module
[ERROR Wed 08 Jun 2022 12:11:43 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-lint' module
[ERROR Wed 08 Jun 2022 12:11:43 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-lsp-signature' module
[ERROR Wed 08 Jun 2022 12:11:43 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-todo' module
[ERROR Wed 08 Jun 2022 12:11:43 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-toggleterm' module
[ERROR Wed 08 Jun 2022 12:11:43 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-tree' module
[ERROR Wed 08 Jun 2022 12:11:43 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-trouble' module
[ERROR Wed 08 Jun 2022 12:11:43 PM CEST] ....config/nvim/lua/doom/modules/built-in/reloader/init.lua:142: Failed to reload 'doom.modules.config.doom-zen' module
[ERROR Wed 08 Jun 2022 12:11:43 PM CEST] ....config/nvim/lua/doom/modules/built-in/compiler/init.lua:7: Doom compiler needs toggleterm plugin, please uncomment the 'terminal' entry in your doom_modules.lua
[ERROR Wed 08 Jun 2022 12:11:43 PM CEST] ...r/.config/nvim/lua/doom/modules/built-in/runner/init.lua:7: Doom runner needs toggleterm plugin, please uncomment the 'terminal' entry in your doom_modules.lua

Anything else:

baurmatt avatar Jun 08 '22 10:06 baurmatt

This has been resolved somewhere in main, let me know if this works for you and I'll re-open if it doesn't :)

connorgmeehan avatar Jul 29 '22 04:07 connorgmeehan

As you know, I'm currently a user of the develop branch ;) Disabling snippets there leads to:

[doom] ^I/Users/mbaur/.config/nvim/init.lua:16: in main chunk
packer.nvim: Error running config for LuaSnip: [string "..."]:0: attempt to index field 'snippets' (a nil value)
[doom] [ERROR 09:33:35] config.lua:83: There was an error loading module 'langs.dockerfile'. Traceback:
[doom] module 'doom.modules.langs.dockerfile' not found:
[doom] ^Ino field package.preload['doom.modules.langs.dockerfile']
[doom] ^Ino file './doom/modules/langs/dockerfile.lua'
[doom] ^Ino file '/opt/homebrew/Cellar/luajit-openresty/2.1-20220411/share/luajit-2.1.0-beta3/doom/modules/langs/dockerfile.lua'
[doom] ^Ino file '/usr/local/share/lua/5.1/doom/modules/langs/dockerfile.lua'
[doom] ^Ino file '/usr/local/share/lua/5.1/doom/modules/langs/dockerfile/init.lua'
[doom] ^Ino file '/opt/homebrew/Cellar/luajit-openresty/2.1-20220411/share/lua/5.1/doom/modules/langs/dockerfile.lua'
[doom] ^Ino file '/opt/homebrew/Cellar/luajit-openresty/2.1-20220411/share/lua/5.1/doom/modules/langs/dockerfile/init.lua'
[doom] ^Ino file './doom/modules/langs/dockerfile.so'
[doom] ^Ino file '/usr/local/lib/lua/5.1/doom/modules/langs/dockerfile.so'
[doom] ^Ino file '/opt/homebrew/Cellar/luajit-openresty/2.1-20220411/lib/lua/5.1/doom/modules/langs/dockerfile.so'
[doom] ^Ino file '/usr/local/lib/lua/5.1/loadall.so'
[doom] ^Ino file './doom.so'
[doom] ^Ino file '/usr/local/lib/lua/5.1/doom.so'
[doom] ^Ino file '/opt/homebrew/Cellar/luajit-openresty/2.1-20220411/lib/lua/5.1/doom.so'
[doom] ^Ino file '/usr/local/lib/lua/5.1/loadall.so'
[doom] stack traceback:
[doom] ^I[C]: at 0x0100e717e4
[doom] ^I[C]: in function 'xpcall'
[doom] ^I/Users/mbaur/.config/nvim/lua/doom/core/config.lua:74: in function 'load'
[doom] ^I/Users/mbaur/.config/nvim/lua/doom/core/init.lua:40: in main chunk
[doom] ^I[C]: in function 'require'
[doom] ^I/Users/mbaur/.config/nvim/init.lua:16: in main chunk
packer.nvim: Error running config for LuaSnip: [string "..."]:0: attempt to index field 'snippets' (a nil value)

baurmatt avatar Jul 29 '22 07:07 baurmatt

Can you please reopen this issue? Seems I'm not allowed to :(

baurmatt avatar Jul 29 '22 07:07 baurmatt

@baurmatt Hi baurmat, my bad I didn't realise you were on develop. It's probably a good idea to move your config to the next release of doom nvim v4.x which is now in main. I'll have a go fixing this issue on develop but I wont have a chance to do this until tomorrow night or later in the week.

https://github.com/NTBBloodbath/doom-nvim/releases/tag/v.4.0.1 This is the latest v4.x release and I recommend switching over, it has some pretty durastic changes to the api that should be stable from now on. Have a look at the docs in the README.md to see the new methods to config your editor.

connorgmeehan avatar Jul 30 '22 03:07 connorgmeehan

@baurmatt This should be resolved in develop let me know if that works for you.

connorgmeehan avatar Aug 01 '22 15:08 connorgmeehan

FWIW I also disable snippets in my config, and that works fine on 4.x. (the reason I disable snippets is that typing )\n inserts a copyright statement, when all I wanted is to close the parenthesis on an expression...). I just comment out "extra_snippets" in modules.lua.

edwintorok avatar Aug 11 '22 22:08 edwintorok

Sweet thanks for that feedback @edwintorok. It should also be fixed in develop (but at this point develop tells you to update to v4.x). Going to mark it as resolved.

connorgmeehan avatar Aug 12 '22 07:08 connorgmeehan

@connorgmeehan I cannot confirm this to be working as expected. I've commented out extra_snippets in modules.lua, opened a new test.yaml and started typing kin. This brought up the snippet suggestion with Kubernetes k-ingress~ snippet.

baurmatt avatar Aug 15 '22 11:08 baurmatt

I was did you run :PackerSync to unload dependencies? This usually needs to be run after making changes to modules.lua? I was able to disable snippets by

  1. Commenting out extra_snippets module
  2. Running :PackerSync
  3. Restarting neovim.

connorgmeehan avatar Aug 16 '22 11:08 connorgmeehan

Thanks, that helped! :)

baurmatt avatar Aug 16 '22 11:08 baurmatt