Previously I talked about snippets in these posts: https://community.dynamics.com/nav/b/conceptsindailynavisionwork/archive/2017/10/23/vscode-snippets-patterns

https://community.dynamics.com/nav/b/conceptsindailynavisionwork/archive/2017/11/29/opinion-is-visual-studio-code-the-best-deal

In the first I talked about the power of Snippets, and how they can be the key to develop with patterns in AL.

The second post is a critic post about VSCode lacks. One of them was that despite power of snippets, they are hard to create. We must go line by line and put quotes, and put scape characters where needed too.

The end of the pain.

When I play with this I thought that could be easy to make a tool for doing all this work for us. But reading Waldo conference in NavTech 2017 I noticed I was late: It´s already done, and more: very well done.

Snippet-creator by Nikita Kunevich.

There is this simple but outstanding extension that do this: from a text selected in VSCode, it makes in four very easy steps a snippet, with Json format.

It´s also easy to find and install, type snippet-creator in the extensions VSCode window and you will get it.

Thank you Mr. Kunevich!!

Example.

Step1: Select text in VSCODE editor:

Step2: type in F1 Create Snippet”:

SnipCreator1

Step 3: Then the Snippet creator ask you these questions:

  • Where you want to save the snippet (Plaintext, AL.Json, etc.).
  • Name.
  • Shortcut.
  • Description.

A screenshot with the result:

SnipCreator2

Very impresive.

The link of the extensión is https://github.com/nikitaKunevich/vscode-snippet-creator 

.