shared.code-snippets 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. {
  2. // Each snippet is defined under a snippet name and has a scope, prefix, body and
  3. // description. The scope defines in watch languages the snippet is applicable. The prefix is what is
  4. // used to trigger the snippet and the body will be expanded and inserted.Possible variables are:
  5. // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
  6. // Placeholders with the same ids are connected.
  7. // Example:
  8. "MSFT Copyright Header": {
  9. "scope": "javascript,typescript,css,rust",
  10. "prefix": [
  11. "header",
  12. "stub",
  13. "copyright"
  14. ],
  15. "body": [
  16. "/*---------------------------------------------------------------------------------------------",
  17. " * Copyright (c) Microsoft Corporation. All rights reserved.",
  18. " * Licensed under the MIT License. See License.txt in the project root for license information.",
  19. " *--------------------------------------------------------------------------------------------*/",
  20. "",
  21. "$0"
  22. ],
  23. "description": "Insert Copyright Statement"
  24. },
  25. "TS -> Inject Service": {
  26. "scope": "typescript",
  27. "description": "Constructor Injection Pattern",
  28. "prefix": "@inject",
  29. "body": "@$1 private readonly _$2: ${1},$0"
  30. },
  31. "TS -> Event & Emitter": {
  32. "scope": "typescript",
  33. "prefix": "emitter",
  34. "description": "Add emitter and event properties",
  35. "body": [
  36. "private readonly _onDid$1 = new Emitter<$2>();",
  37. "readonly onDid$1: Event<$2> = this._onDid$1.event;"
  38. ],
  39. }
  40. }