IDE Code Snippets
hias codesnippets generates IDE code snippets for quickly inserting translation ignore comments.
Basic Command
sh
hias codesnippets # Auto-detect IDE (.vscode / .idea / .cursor)
hias codesnippets vscode # Generate VS Code snippets
hias codesnippets webstorm # Generate WebStorm templates
hias codesnippets cursor # Generate Cursor snippets
hias codesnippets sublime # Generate Sublime Text snippetsAuto Detection
The command automatically detects the IDE type in your workspace:
| Directory | Detection Result |
|---|---|
.vscode/ | VS Code |
.idea/ | WebStorm / IntelliJ |
.cursor/ | Cursor |
| No match | Default VS Code |
Generated Snippets
| Prefix | Purpose |
|---|---|
@hias-i18n-ignore-next | Ignore next extractable segment |
@hias-i18n-ignore-start | Ignore range start |
@hias-i18n-ignore-end | Ignore range end |
@hias-i18n-ignore-file | Ignore entire file |
Usage
VS Code / Cursor
- Run
hias codesnippets vscode - Type
@hias-i18n-ignore-nextin code - Press Tab to expand
WebStorm
- Run
hias codesnippets webstorm - View in Settings > Editor > Live Templates
Sublime Text
- Run
hias codesnippets sublime - Type
@hias-i18n-ignore-nextin code - Press Tab to expand
Snippet Content
Each snippet includes bilingual descriptions, for example:
json
{
"忽略下一段翻译": {
"prefix": "@hias-i18n-ignore-next",
"body": ["// @hias-i18n-ignore-next", "$1"],
"description": "忽略下一段翻译 (Ignore next extractable segment)"
}
}