Crates.io | vscode-generator |
lib.rs | vscode-generator |
version | 0.2.0 |
source | src |
created_at | 2024-08-05 22:58:34.045288 |
updated_at | 2024-11-11 14:28:32.949746 |
description | A powerful VSCode snippets generator with support for multiple languages. Create, manage and share your code snippets effortlessly. |
homepage | |
repository | https://github.com/SynapDrake/crate-add-macro |
max_upload_size | |
id | 1326627 |
size | 47,821 |
🛠️ A flexible toolkit for crafting VS Code extensions. This library streamlines the development process while maintaining high standards of 🚀 code quality and 🎯 user experience.
Cargo.toml
:[dependencies]
vscode-generator = "<latest-version>"
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")?;
📝 You can write this snippets to your VS Code custom user snippets folder Locales:
%APPDATA%/Code/User/snippets
~/Library/Application Support/Code/User/snippets
~/.config/Code/User/snippets
//!
💡 Or simply access it via VS Code:Ctrl/Cmd + Shift + P
For detailed snippets documentation and advanced features, see [snippets
] module.