print erroneous snippet location
This commit is contained in:
parent
698f2d4910
commit
08b96cbdb2
@ -121,12 +121,14 @@ class SnippetDefinition(object):
|
|||||||
exec(code, {'snip': snip})
|
exec(code, {'snip': snip})
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
e.snippet_info = textwrap.dedent("""
|
e.snippet_info = textwrap.dedent("""
|
||||||
|
Defined in: {}
|
||||||
Trigger: {}
|
Trigger: {}
|
||||||
Description: {}
|
Description: {}
|
||||||
Context: {}
|
Context: {}
|
||||||
Pre-expand: {}
|
Pre-expand: {}
|
||||||
Post-expand: {}
|
Post-expand: {}
|
||||||
""").format(
|
""").format(
|
||||||
|
self._location,
|
||||||
self._trigger,
|
self._trigger,
|
||||||
self._description,
|
self._description,
|
||||||
self._context_code if self._context_code else '<none>',
|
self._context_code if self._context_code else '<none>',
|
||||||
|
@ -304,3 +304,13 @@ class ParseSnippets_PrintErroneousSnippetPostAction(_VimTest):
|
|||||||
keys = 'test' + EX
|
keys = 'test' + EX
|
||||||
wanted = keys
|
wanted = keys
|
||||||
expected_error = "Post-expand: asd"
|
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