From 886d4348494b21a4962f4b063bdc5f69e39bca82 Mon Sep 17 00:00:00 2001 From: yannickreiss Date: Mon, 24 Feb 2025 07:37:01 +0100 Subject: [PATCH] Adjust Ada snippets to styleguide --- UltiSnips/ada.snippets | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/UltiSnips/ada.snippets b/UltiSnips/ada.snippets index 96ca6de..0fb6aa1 100644 --- a/UltiSnips/ada.snippets +++ b/UltiSnips/ada.snippets @@ -36,15 +36,15 @@ def find_candidate(tabstop, search_type): endglobal snippet helloworld "Hello world example to test features" b --- `!p snip.rv = fn` --- Created on: `date` --- Author(s): Yannick Reiss --- Content: Hello world example +-- `!p snip.rv = fn` +-- Created on: `date` +-- Author(s): Yannick Reiss +-- Content: Hello world example with Ada.Text_IO; use Ada.Text_IO; --- @name ${1:`!p snip.rv = fn[0].upper() + fn[1:].split('.')[0]`} --- @return --- @description Function printing hello world. +-- @name ${1:`!p snip.rv = fn[0].upper() + fn[1:].split('.')[0]`} +-- @return +-- @description Function printing hello world. procedure $1 is begin @@ -53,16 +53,16 @@ end $1;$0 endsnippet snippet docstring "Document String with most important information" b --- `!p snip.rv = fn` --- Created on: `date` --- Author(s): ${1:Yannick Reiß} --- Description: ${2:`!p snip.rv = fn.split('.')[0]`} +-- `!p snip.rv = fn` +-- Created on: `date` +-- Author(s): ${1:Yannick Reiß} +-- Description: ${2:`!p snip.rv = fn.split('.')[0]`} $0 endsnippet snippet procedure "insert procedure" b --- @name $1 --- @return +-- @name $1 +-- @return `!p snip.rv = "" if t[2].startswith("l"): @@ -96,7 +96,7 @@ for variable in variables: if not variable == "" and not variable.startswith("typ"): variableless = variable.replace("\t", "").replace (" ", "") snip.rv += f"-- @variable {variableless}\n" -`-- @description $4 +`-- @description $4 procedure ${1:`!p snip.rv = fn.split('.')[0].capitalize()`} `!p snip.rv = "" if t[2] == "" else "("`${2:N : Natural}`!p snip.rv = "" if t[2] == "" else ")"` is $3 begin @@ -105,8 +105,8 @@ end $1;$0 endsnippet snippet function "insert function" b --- @name $1 --- @return $3 +-- @name $1 +-- @return $3 `!p snip.rv = "" if t[2].startswith("l"): @@ -129,7 +129,7 @@ for parameter in parameters: for parameter in parameter_list: if not parameter == "" and not parameter.startswith("typ"): parameterless = parameter.replace("\t", "") - snip.rv += f"-- @parameter {parameterless}\n" + snip.rv += f"-- @parameter {parameterless}\n" ``!p snip.rv = "" if t[4].startswith("l"): @@ -139,7 +139,7 @@ else: for variable in variables: if not variable == "" and not variable.startswith("typ") and not variable.startswith("--"): variableless = variable.replace("\t", "").replace (" ", "") - snip.rv += f"-- @variable {variableless}\n" + snip.rv += f"-- @variable {variableless}\n" ` -- @description $5 function ${1:`!p snip.rv = fn.split('.')[0].capitalize()`} `!p snip.rv = "" if t[2] == "" else "("`${2:N : Natural}`!p snip.rv = "" if t[2] == "" else ")"` return ${3:Natural} is $4 @@ -178,7 +178,7 @@ project ${1:Default} is for Main use ("${5:main.adb}"); for Languages use ("Ada"); end $1; --- Create dir? (y/): ${6:no}`!p +-- Create dir? (y/): ${6:no}`!p from os import system if t[6] == "y": system(f"mkdir -p {t[2]}")