From cded48d484676b2a85a71a305a0a43c7a44ba3d9 Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Thu, 14 Apr 2022 22:59:23 +0300 Subject: [PATCH] feat(snippets): some changes --- .emacs.d/snippets/typescript-mode/nest-api-query | 2 +- .emacs.d/snippets/typescript-mode/private-method | 2 +- .emacs.d/snippets/typescript-mode/private-service | 4 ++++ .emacs.d/snippets/typescript-mode/public-async-method | 2 +- .emacs.d/snippets/typescript-mode/public-method | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 .emacs.d/snippets/typescript-mode/private-service diff --git a/.emacs.d/snippets/typescript-mode/nest-api-query b/.emacs.d/snippets/typescript-mode/nest-api-query index 62d15d6..d351763 100644 --- a/.emacs.d/snippets/typescript-mode/nest-api-query +++ b/.emacs.d/snippets/typescript-mode/nest-api-query @@ -1,6 +1,6 @@ # key: apiq # name: nest-api-query -# condition: (string-match-p (rx controller.ts eos) (buffer-file-name)) +# condition: (string-match-p (rx "controller.ts" eos) (buffer-file-name)) # -- @ApiQuery({ name: '$1', diff --git a/.emacs.d/snippets/typescript-mode/private-method b/.emacs.d/snippets/typescript-mode/private-method index 7f8531d..90194a8 100644 --- a/.emacs.d/snippets/typescript-mode/private-method +++ b/.emacs.d/snippets/typescript-mode/private-method @@ -2,6 +2,6 @@ # name: private-method # key: pm # -- -private $1 ($2)${3:$$(if (string-empty-p yas-text) "" (if (string-match-p (rx bos ":") yas-text) yas-text (format ": %s" yas-text)))} { +private $1($2)${3:$$(if (string-empty-p yas-text) "" (if (string-match-p (rx bos ":") yas-text) yas-text (format ": %s" yas-text)))} { $0 } \ No newline at end of file diff --git a/.emacs.d/snippets/typescript-mode/private-service b/.emacs.d/snippets/typescript-mode/private-service new file mode 100644 index 0000000..e507b6f --- /dev/null +++ b/.emacs.d/snippets/typescript-mode/private-service @@ -0,0 +1,4 @@ +# key: prs +# name: private-service +# -- +private ${1:service}Service: ${1:$(capitalize yas-text)}Service$0 \ No newline at end of file diff --git a/.emacs.d/snippets/typescript-mode/public-async-method b/.emacs.d/snippets/typescript-mode/public-async-method index 27e3988..3d09f3a 100644 --- a/.emacs.d/snippets/typescript-mode/public-async-method +++ b/.emacs.d/snippets/typescript-mode/public-async-method @@ -2,6 +2,6 @@ # name: public-async-method # key: pam # -- -public async $1 ($2)${3:$$(if (string-empty-p yas-text) "" (if (string-match-p (rx bos ":") yas-text) yas-text (format ": %s" yas-text)))} { +public async $1($2)${3:$$(if (string-empty-p yas-text) "" (if (string-match-p (rx bos ":") yas-text) yas-text (format ": %s" yas-text)))} { $0 } \ No newline at end of file diff --git a/.emacs.d/snippets/typescript-mode/public-method b/.emacs.d/snippets/typescript-mode/public-method index 10b15e9..9ade1ea 100644 --- a/.emacs.d/snippets/typescript-mode/public-method +++ b/.emacs.d/snippets/typescript-mode/public-method @@ -1,6 +1,6 @@ # key: um # name: public-method # -- -public $1 ($2)${3:$$(if (string-empty-p yas-text) "" (if (string-match-p (rx bos ":") yas-text) yas-text (format ": %s" yas-text)))} { +public $1($2)${3:$$(if (string-empty-p yas-text) "" (if (string-match-p (rx bos ":") yas-text) yas-text (format ": %s" yas-text)))} { $0 } \ No newline at end of file