Skip to content

Instantly share code, notes, and snippets.

@LokeshSagi
Created July 6, 2020 06:14
Show Gist options
  • Save LokeshSagi/1cdad7ac2d1f289cc343b80cf15211bb to your computer and use it in GitHub Desktop.
Save LokeshSagi/1cdad7ac2d1f289cc343b80cf15211bb to your computer and use it in GitHub Desktop.
VSCode snippet to import Custom Label in JS
{
"importLabel": {
"scope": "javascript,typescript",
"prefix": "imp-label",
"body": "import $1 from '@salesforce/label/c.$2'",
"description": "import custom label in js"
}
}
-> Click on Settings (wrench icon) and select User Snippets
-> Select the type of snippet (generally select 'New Global Snippet File' to create a snippet and make it available across the projects and languages)
-> give a snippet name
-> copy the code from above file (change the scope, prefix, description as required)
-> in the required js, ts file, start typing 'imp-label' and select the suggestion with the given decription.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment