Marketplace/download link: https://marketplace.visualstudio.com/items?itemName=germainitalic.markdown-wrap-code
Wraps the selected text into triple backticks fence:
Look for "Markdown Wrap in Triple Backticks" in the command palette.
Select the text to wrap and press ctrl+E
.
ctrl+E
is usually already binded, you need to open the bindings editor (ctrl+k
ctrl+s
) and unbind.
To set your own shortcut, add this to your keybindings.json
:
{
"key": "ctrl+e",
"command": "wrapInTripleBackticks",
"when": "editorTextFocus"
}
Initial release of the extension.
- Navigating to Your Project: Navigate to your project directory in the terminal.
cd path/to/your/extension
- Opening in VS Code: Open the project in Visual Studio Code if it's not already open.
code .
- Installing Dependencies: If you've added new dependencies or are working on a different machine, you'll need to reinstall the npm packages.
npm install
- Compiling TypeScript: If your extension uses TypeScript, compile it into JavaScript.
tsc
Or, for continuous compilation:
tsc -w
if tsc is installed locally (npm install --save-dev typescript
) and not globally (npm install -g typescript
), run:
./node_modules/.bin/tsc
- Running the Extension: To test your changes, you can run the extension in a new Extension Development Host window.
Press F5
in VS Code to start debugging and open a new window where your extension is activated.
-
Insert Breakpoints: Insert breakpoints in your code within VS Code to debug it.
-
Inspect Output: Use
console.log()
statements for simple debugging, and inspect the Output panel (Ctrl+Shift+U
) in the Extension Development Host window.
- Update Version: Before republishing your extension, remember to update the version number in
package.json
.
To package your Visual Studio Code extension, you can use the vsce
command-line tool, which is designed to help you manage VS Code extensions. Here are the steps to package your extension:
- Install
vsce
if you haven't yet:
npm install -g vsce
- Navigate to your extension directory:
cd path/to/your/extension
- Install Dependencies: Make sure all dependencies are installed. This usually means running:
npm install
- Compile the Project: If you're using TypeScript, make sure to compile your project into JavaScript.
tsc
- Package the Extension: Run the following command to package your extension into a
.vsix
file.
vsce package
After running this command, vsce
will package your extension into a .vsix
file. This .vsix
file is what you'll upload to the Visual Studio Marketplace if you decide to publish your extension. Alternatively, you can install it manually using this .vsix
file.
To install a .vsix
manually, open Visual Studio Code, go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window. Then click the "..." at the top of the Extensions view, choose "Install from VSIX..." and select your .vsix
file.
You can also install it from the command line:
code --install-extension your-extension.vsix
Remember to replace your-extension.vsix
with the actual file name of your .vsix
file.
- Publishing the Extension: If you've made changes that you want to publish, use the
vsce
(npm install -g vsce
) package to publish the extension to the marketplace.
vsce publish