diff --git a/pythonx/UltiSnips/snippet/definition/_base.py b/pythonx/UltiSnips/snippet/definition/_base.py index a974334..77c1f63 100644 --- a/pythonx/UltiSnips/snippet/definition/_base.py +++ b/pythonx/UltiSnips/snippet/definition/_base.py @@ -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 '', diff --git a/test/test_ParseSnippets.py b/test/test_ParseSnippets.py index 1b2b327..f9b4d3b 100644 --- a/test/test_ParseSnippets.py +++ b/test/test_ParseSnippets.py @@ -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"