sauliusbira
Kilo Explorer

Basically this is extension of treycarroll work done in Visual Studio Code Snippets for common ServiceNow Syntax Macros I have   create snippets for Visual Studio Code.

Download javascript.json file and put it:

  • Windows %APPDATA%\Code\User\snippets\javascript.json
  • Mac $HOME/Library/Application Support/Code/User/snippets/javascript.json
  • Linux $HOME/.config/Code/User/snippets/javascript.json

Example of snippet description:

{

  "Insert GlideRecord": {

  "prefix": "grins",

  "body": [

  "var gr = new GlideRecord('${1:TableName}');",

  "gr.Initialize();",

  "gr.${2:UpdateColumnName} = '${3:UpdateColumnValue}';",

  "gr.insert();"

  ],

  "description": "Template for inserting a GlideRecord record."

  }

}

Start your Visual Studio Code and if you create JavaScript file you should be able to use these macros.

VisualStudioCodeCustom1.PNG

When template generate use Tab to jump to the next editable area:

VisualStudioCodeCustom2.PNG

Feel free to update macros but don't forget to share it

Comments
Balaji43
Kilo Contributor

Thanks for this, I have downloaded the file and followed the step, but I am not getting the methods of GlideRecord as shown above in my Visual Studio Code.

Is that something I am missing?

Version history
Last update:
‎02-14-2017 03:30 AM
Updated by: