Skip to content

Commit 7db9048

Browse files
author
stevestein
committed
drafting, remove template links
1 parent eb9fe2a commit 7db9048

4 files changed

Lines changed: 253 additions & 13 deletions

File tree

docs/carbon/code-snippets.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ The snippet syntax follows the [TextMate snippet syntax](https://manual.macromat
2323
![ajax snippet](media/code-snippets/ajax-snippet.gif)
2424

2525
## Add Snippets from the Marketplace
26+
CARBON??
27+
Many [extensions](/docs/editor/extension-gallery.md) on the VS Code [Marketplace](https://marketplace.visualstudio.com/vscode) include snippets. If you find one you want to use, install it and restart VS Code and the new snippet is available (see [here](/docs/editor/extension-gallery.md#browse-and-install-extensions) for more instructions on installing an extension).
2628

27-
Many [extensions](/docs/editor/extension-gallery.md) on the VS Code [Marketplace](https://marketplace.visualstudio.com/vscode) include snippets. If you find one you want to use, install it and restart VS Code and the new snippet will be available (see [here](/docs/editor/extension-gallery.md#browse-and-install-extensions) for more instructions on installing an extension).
28-
29-
Below are some popular extensions which include snippets in their language support:
29+
The following popular extensions include snippets in their language support:
3030

3131
<div class="marketplace-extensions-snippets"></div>
3232

33-
> Tip: The extensions shown above are dynamically queried. Click on an extension tile above to read the description and reviews to decide which extension is best for you. See more in the [Marketplace](https://marketplace.visualstudio.com/vscode).
33+
> Tip: The preceding extensions are dynamically queried. Click on an extension tile above to read the description and reviews to decide which extension is best for you. See more in the [Marketplace](https://marketplace.visualstudio.com/vscode).
3434
3535
## Creating your Own Snippets
3636

@@ -74,11 +74,11 @@ With tabstops, you can make the editor cursor move inside a snippet. Use `$1`, `
7474

7575
### Placeholders
7676

77-
Placeholders are tabstops with values, like `${1:foo}`. The placeholder text will be inserted and selected such that it can be easily changed. Placeholders can be nested, like `${1:another ${2:placeholder}}`.
77+
Placeholders are tabstops with values, like `${1:foo}`. The placeholder text is inserted such that it can be easily changed. Placeholders can be nested, like `${1:another ${2:placeholder}}`.
7878

7979
### Choice
8080

81-
Placeholders can have choices as values. The syntax is a comma separated enumeration of values, enclosed with the pipe-character, for example `${1|one,two,three|}`. When the snippet is inserted and the placeholder selected, choices will prompt the user to pick one of the values.
81+
Placeholders can have choices as values. The syntax is a comma-separated enumeration of values, enclosed with the pipe-character, for example `${1|one,two,three|}`. When the snippet is inserted and the placeholder selected, choices prompt the user to pick one of the values.
8282

8383
### Variables
8484

@@ -89,8 +89,8 @@ The following variables can be used:
8989
* `TM_SELECTED_TEXT` The currently selected text or the empty string
9090
* `TM_CURRENT_LINE` The contents of the current line
9191
* `TM_CURRENT_WORD` The contents of the word under cursor or the empty string
92-
* `TM_LINE_INDEX` The zero-index based line number
93-
* `TM_LINE_NUMBER` The one-index based line number
92+
* `TM_LINE_INDEX` The zero-index-based line number
93+
* `TM_LINE_NUMBER` The one-index-based line number
9494
* `TM_FILENAME` The filename of the current document
9595
* `TM_FILENAME_BASE` The filename of the current document without its extensions
9696
* `TM_DIRECTORY` The directory of the current document
@@ -122,7 +122,7 @@ ${TM_FILENAME/(.*)\..+$/$1/}
122122

123123
### Grammar
124124

125-
Below is the EBNF ([extended Backus-Naur form](https://en.wikipedia.org/wiki/Extended_Backus-Naur_form)) for snippets. With `\` (backslash), you can escape `$`, `}` and `\`. Within choice elements, the backslash also escapes comma and pipe characters.
125+
Below is the EBNF ([extended Backus-Naur form](https://en.wikipedia.org/wiki/Extended_Backus-Naur_form)) for snippets. With `\` (backslash), you can escape `$`, ༖༗, and `\`. Within choice elements, the backslash also escapes comma and pipe characters.
126126

127127
```
128128
any ::= tabstop | placeholder | choice | variable | text
@@ -146,7 +146,7 @@ text ::= .*
146146

147147
## Using TextMate snippets
148148

149-
You can also use existing TextMate snippets (.tmSnippets) with VS Code. See the [Using TextMate Snippets](/docs/extensions/themes-snippets-colorizers.md#using-textmate-snippets) topic in our Extension Authoring section to learn more.
149+
You can also use existing TextMate snippets (.tmSnippets) with VS Code. See the [Using TextMate Snippets](/docs/extensions/themes-snippets-colorizers.md#using-textmate-snippets) article in our Extension Authoring section to learn more.
150150

151151
## Assign keybindings to snippets
152152

@@ -163,14 +163,14 @@ We already know that snippets can be inserted via IntelliSense, the 'Insert Snip
163163
}
164164
```
165165

166-
It will invoke the 'Insert Snippet'-action but instead of letting you select a snippet it will run on the provided snippet. Also, instead of `snippet` you can have `langId` and `name` arguments to reference an existing snippet: `{ "langId": "csharp", "name": "myFavSnippet" }`
166+
It invokes the 'Insert Snippet'-action but instead of letting you select a snippet it runs on the provided snippet. Also, instead of `snippet` you can have `langId` and `name` arguments to reference an existing snippet: `{ "langId": "csharp", "name": "myFavSnippet" }`
167167

168168

169169
## Next Steps
170170

171-
* [Command Line](/docs/editor/command-line.md) - VS Code has a rich command line interface to open or diff files and install extensions.
171+
* [Command Line](/docs/editor/command-line.md) - VS Code has a rich command-line interface to open or diff files and install extensions.
172172
* [Extending Visual Studio Code](/docs/extensions/overview.md) - Learn about other ways to extend VS Code.
173-
* [Themes, Snippets, and Colorizers](/docs/extensions/themes-snippets-colorizers.md) - You can package themes, snippets and language colorizers for use in VS Code.
173+
* [Themes, Snippets, and Colorizers](/docs/extensions/themes-snippets-colorizers.md) - You can package themes, snippets, and language colorizers for use in VS Code.
174174

175175
## Common Questions
176176

11.4 KB
Loading
41.7 KB
Loading

0 commit comments

Comments
 (0)