my-bitburner/.vscode/snippets.code-snippets

43 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

2021-12-24 03:21:18 +09:00
{
2021-12-30 03:27:12 +09:00
"ns-template": {
"scope": "typescript",
"prefix": "template",
"body": [
"import { NS } from '@ns'",
2021-12-30 03:27:12 +09:00
"",
"export async function main(ns : NS) : Promise<void> {",
"\t//",
"}"
]
},
"autocomplete": {
"scope": "typescript",
"prefix": "autocomplete",
"body": [
"// eslint-disable-next-line @typescript-eslint/no-unused-vars",
2022-08-20 10:09:52 +09:00
"export function autocomplete(data : AutocompleteData, args : string[]) : string[] {",
2021-12-30 03:27:12 +09:00
"\treturn [...data.servers]",
"}"
],
"description": "autocomplete"
2022-08-20 10:09:52 +09:00
},
"template-advanced":{
"scope": "typescript",
"prefix": "template-advanced",
"body": [
"import { NS } from '@ns'",
"import { parse } from './lib/flag';",
"import { sprintf } from './lib/printf';",
"",
"export async function main(ns: NS) : Promise<void> {",
" const flag = parse(ns.args.map(x=>x.toString()));",
" if(flag.h || flag.help){",
" const msg = ['run cmd']",
" msg.forEach(x=>ns.tprint(x));",
" return;",
" }",
"}"
],
"description": "autocomplete"
2021-12-30 03:27:12 +09:00
}
2021-12-24 03:21:18 +09:00
}