Skip to content

Error on +snippet/edit #4127

@Janfel

Description

@Janfel

What actually happened?
Calling +snippet/edit interactively on some snippets throws an error. Backtrace below.

Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
  aref(nil 6)
  (progn (aref template 6))
  (progn (progn (aref template 6)))
  (let* ((major-mode (if (eq major-mode 'snippet-mode) (intern (file-name-base (directory-file-name default-directory))) major-mode)) (template (yas--get-template-by-uuid major-mode template-uuid)) (template-path (progn (progn (aref template 6))))) (if (file-in-directory-p template-path +snippets-dir) (find-file template-path) (let ((buf (get-buffer-create (format "*%s*" (file-name-nondirectory template-path))))) (save-current-buffer (set-buffer (switch-to-buffer buf)) (insert-file-contents template-path) (snippet-mode) (setq default-directory (expand-file-name (file-name-nondirectory template-path) (expand-file-name (symbol-name major-mode) +snippets-dir)))))))
  +snippets/edit("comment")
  #(+snippets/edit "comment")
  apply(# (+snippets/edit "comment"))
  funcall-interactively(+snippets/edit "comment")
  #(+snippets/edit nil nil)
  apply(# (+snippets/edit nil nil))
  explain-pause--wrap-call-interactively(# +snippets/edit nil nil)
  apply(explain-pause--wrap-call-interactively # (+snippets/edit nil nil))
  call-interactively(+snippets/edit nil nil)
  command-execute(+snippets/edit)

Steps to reproduce:

  1. Open a new emacs-lisp-mode buffer.
  2. Call +snippets/edit (e.g. C-c & C-v).
  3. Choose snippet yn (for y-or-n-p).

System information:

SYSTEM  type       gnu/linux
	config     x86_64-pc-linux-gnu
	shell      /usr/bin/zsh
	uname      Linux 5.8.16-2-MANJARO #1 SMP PREEMPT Mon Oct 19 11:33:03 UTC 2020 x86_64
	path       (~/bin ~/opt/bin /usr/local/bin /usr/bin ~/.local/bin /usr/local/sbin /usr/lib/jvm/default/bin ~/.dotnet/tools ~/var/go/bin ~/.local/share/cabal/bin ~/opt/ghcup/bin ~/.gem/ruby/2.7.0 ~/.local/share/cargo/bin /usr/lib/emacs/27.1/x86_64-pc-linux-gnu)
EMACS   dir        ~/opt/doom-emacs/
	version    27.1
	build      Aug 28, 2020
	buildopts  --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var --with-x-toolkit=gtk3 --with-xft --with-wide-int --with-modules --with-cairo --with-harfbuzz 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt' CPPFLAGS=-D_FORTIFY_SOURCE=2 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now
	features   XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2 GMP
	traits     (batch server-running envvar-file)
DOOM    dir        ~/.config/doom-emacs/
	version    2.0.9
	build      HEAD -> develop ff6699e79 2020-10-21 12:04:52 -0400
	elc-files  0
	modules    (:completion (company +childframe) ivy :ui doom doom-dashboard doom-quit hl-todo modeline nav-flash neotree ophints (popup +defaults) vc-gutter window-select workspaces :editor (evil +everywhere) file-templates fold (&user fmt +define) rotate-text snippets :emacs dired electric ibuffer undo vc :term vterm :checkers syntax :tools editorconfig (eval +overlay) lookup lsp magit make :lang data emacs-lisp markdown org sh yaml (&user arduino) (&user basic) (cc +lsp) clojure common-lisp elixir (&user fennel) (haskell +dante) latex (lua +moonscript) (python +lsp) (rust +lsp) scheme :config (&user literate) (default +evil +bindings +smartparens))
	packages   ((meson-mode) (moonscript :pin ac5d35d3a1970db958c687991a1f2c49f7921150 :recipe (:fork (:host github :repo Janfel/moonscript-mode))) (php-mode) (rustic :pin ee541d6247b48e1cc103eee8f8e7d93c88fb0a2a) (async) (flycheck-clang-tidy) (evil-escape :disable t) (evil-matchit) (form-feed) (highlight-indent-guides) (hungry-delete) (company-quickhelp) (company-jedi))
	unpin      (n/a)
	elpa       (n/a)

Metadata

Metadata

Assignees

No one assigned

    Labels

    is:bugSomething isn't working as intendedis:upstreamOriginates from outside the project and cannot be fully addressed heremodule:completion/helmPertains to Doom's :completion helm modulemodule:completion/ivyPertains to Doom's :completion ivy modulemodule:completion/verticoPertains to Doom's :completion vertico modulemodule:editor/snippetsPertains to Doom's :editor snippets module

    Type

    No type

    Projects

    Status

    Resolved

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions