vscode-generator

Crates.iovscode-generator
lib.rsvscode-generator
version0.2.0
sourcesrc
created_at2024-08-05 22:58:34.045288
updated_at2024-11-11 14:28:32.949746
descriptionA powerful VSCode snippets generator with support for multiple languages. Create, manage and share your code snippets effortlessly.
homepage
repositoryhttps://github.com/SynapDrake/crate-add-macro
max_upload_size
id1326627
size47,821
Bulat Sharipov (SynapDrake)

documentation

https://docs.rs/vscode-generator

README

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
Commit count: 35

cargo fmt