From a14f999ab9c839516de431ca2b8e82413a7c4dd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 11 Feb 2024 21:14:21 +0100 Subject: [PATCH] feat(nvim): add python snippets --- .../programs/nvim/plugins/snippets/python.lua | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/modules/programs/nvim/plugins/snippets/python.lua b/modules/programs/nvim/plugins/snippets/python.lua index f370ef4..6453645 100644 --- a/modules/programs/nvim/plugins/snippets/python.lua +++ b/modules/programs/nvim/plugins/snippets/python.lua @@ -183,6 +183,51 @@ local dot_try = postfix(".try", { end), }) +local parr = s( + "parr", + fmt( + [[ + :param {name}: {description} + :type {name}: {type} + ]], + { + name = i(1, "name"), + description = i(2, "description"), + type = i(3, "type"), + }, + { + repeat_duplicates = true, + } + ) +) + +local retr = s( + "retr", + fmt( + [[ + :return: {description} + :rtype: {rtype} + ]], + { + description = i(1, "description"), + rtype = i(2, "rtype"), + } + ) +) + +local raisr = s( + "raisr", + fmt( + [[ + :raises {exception}: {description} + ]], + { + exception = i(1, "Exception"), + description = i(2, "description"), + } + ) +) + return { def, defs, @@ -191,4 +236,7 @@ return { dot_items, dot_try, enum, + parr, + retr, + raisr, }