print erroneous snippet location
This commit is contained in:
parent
698f2d4910
commit
08b96cbdb2
@ -121,12 +121,14 @@ class SnippetDefinition(object):
|
||||
exec(code, {'snip': snip})
|
||||
except Exception as e:
|
||||
e.snippet_info = textwrap.dedent("""
|
||||
Defined in: {}
|
||||
Trigger: {}
|
||||
Description: {}
|
||||
Context: {}
|
||||
Pre-expand: {}
|
||||
Post-expand: {}
|
||||
""").format(
|
||||
self._location,
|
||||
self._trigger,
|
||||
self._description,
|
||||
self._context_code if self._context_code else '<none>',
|
||||
|
@ -304,3 +304,13 @@ class ParseSnippets_PrintErroneousSnippetPostAction(_VimTest):
|
||||
keys = 'test' + EX
|
||||
wanted = keys
|
||||
expected_error = "Post-expand: asd"
|
||||
|
||||
class ParseSnippets_PrintErroneousSnippetLocation(_VimTest):
|
||||
files = { 'us/all.snippets': r"""
|
||||
post_expand "asd()"
|
||||
snippet test
|
||||
endsnippet
|
||||
"""}
|
||||
keys = 'test' + EX
|
||||
wanted = keys
|
||||
expected_error = "Defined in: .*/all.snippets"
|
||||
|
Loading…
Reference in New Issue
Block a user