feat(file-templates): improve diagnostic command
Emit a more helpful error message if a rule was found but yasnippet can't find the associated snippet.
This commit is contained in:
parent
425f6a1264
commit
0ca34af323
1 changed files with 7 additions and 1 deletions
|
@ -119,4 +119,10 @@ evil is loaded and enabled)."
|
|||
"Tests the current buffer and outputs the file template rule most appropriate
|
||||
for it. This is used for testing."
|
||||
(interactive)
|
||||
(message "Found %s" (cl-find-if #'+file-template-p +file-templates-alist)))
|
||||
(let ((template (cl-find-if #'+file-template-p +file-templates-alist)))
|
||||
(if (cl-find trigger (yas--all-templates
|
||||
(yas--get-snippet-tables
|
||||
(plist-get template :mode)))
|
||||
:key #'yas--template-key :test #'equal)
|
||||
(message "Found %s" template)
|
||||
(message "Found rule, but can't find associated snippet: %s" template))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue