#snippets #visual-studio-code #generator #productivity #extension #development-tools

build vscode-generator

A powerful VSCode snippets generator with support for multiple languages. Create, manage and share your code snippets effortlessly.

4 releases

0.2.0 Nov 11, 2024
0.1.2 Aug 12, 2024
0.1.1 Aug 9, 2024
0.1.0 Aug 5, 2024

#208 in Build Utils

Download history 217/week @ 2024-08-05 141/week @ 2024-08-12 28/week @ 2024-09-16 15/week @ 2024-09-23 32/week @ 2024-09-30 128/week @ 2024-11-11

128 downloads per month

MIT license

31KB
296 lines

github crates.io docs.rs

VS Code Extensions Generator

🛠️ A flexible toolkit for crafting VS Code extensions. This library streamlines the development process while maintaining high standards of 🚀 code quality and 🎯 user experience.

Overview

  • ✨ Snippets generation with builder pattern
  • 🎯 Future support for other VS Code extensions (planned)
  • 🛠 Rich customization options
  • ⚡ Efficient and type-safe implementation

Using

Add to your Cargo.toml:

[dependencies]
vscode-generator = "<latest-version>"

Generating Snippets

use vscode_generator::{ Snippet, SnippetsFile };

// create snippets:
let snippet = Snippet::builder()
    .set_prefix("fn")
    .set_body(vec![
        "fn ${1:name}(${2:args}) ${3:-> ReturnType }{",
        "    ${0}",
        "}"
    ])
    .set_description("Create a new function")
    .set_scope("rust")
    .build()?;

// save snippets to file:
let snippets_file = SnippetsFile::new(vec![snippet]);
snippets_file.write_to("./snippets/rust.code-snippets")?;

User Snippets

📝 You can write this snippets to your VS Code custom user snippets folder Locales:

  • 🗂️ Windows: %APPDATA%/Code/User/snippets
  • 🍎 MacOS: ~/Library/Application Support/Code/User/snippets
  • 🐧 Linux: ~/.config/Code/User/snippets //! 💡 Or simply access it via VS Code:
  1. Press Ctrl/Cmd + Shift + P
  2. Type "Snippets: Configure User Snippets"
  3. Select the language or create a new snippet file

For detailed snippets documentation and advanced features, see snippets module.

Future Extensions (Planned)

  • 🎨 Color Themes
  • 🔧 Language Support
  • ⚙️ Custom Commands
  • 🧩 Workspace Configuration

Dependencies

~0.7–1.6MB
~34K SLoC