|
| 1 | +/** |
| 2 | + * Standard module for [denops.vim](https://github.com/vim-denops/denops.vim). |
| 3 | + * |
| 4 | + * This module is assumed to be used for developing denops plugins. The code |
| 5 | + * is assumed to be called in a dedicated worker thread of each plugins. |
| 6 | + * |
| 7 | + * By using this module, developers can write Vim/Neovim denops plugins like: |
| 8 | + * |
| 9 | + * ```typescript |
| 10 | + * import { Denops } from "./mod.ts"; |
| 11 | + * import * as fn from "./function/mod.ts"; |
| 12 | + * import * as vars from "./variable/mod.ts"; |
| 13 | + * import * as helper from "./helper/mod.ts"; |
| 14 | + * |
| 15 | + * import * as unknownutil from "https://deno.land/x/unknownutil/mod.ts"; |
| 16 | + * |
| 17 | + * export async function main(denops: Denops): Promise<void> { |
| 18 | + * denops.dispatcher = { |
| 19 | + * async say(where: unknown): Promise<void> { |
| 20 | + * unknownutil.assertString(where); |
| 21 | + * |
| 22 | + * const name = await fn.input(denops, "Your name: "); |
| 23 | + * const progname = await vars.v.get(denops, "progname"); |
| 24 | + * const messages = [ |
| 25 | + * `Hello ${where}.`, |
| 26 | + * `Your name is ${name}.`, |
| 27 | + * `This is ${progname}.`, |
| 28 | + * ]; |
| 29 | + * await helper.echo(denops, messages.join("\n")); |
| 30 | + * }, |
| 31 | + * }; |
| 32 | + * |
| 33 | + * await helper.execute( |
| 34 | + * denops, |
| 35 | + * ` |
| 36 | + * command! HelloWorld call denops#notify("${denops.name}", "say", ["World"]) |
| 37 | + * command! HelloDenops call denops#notify("${denops.name}", "say", ["Denops"]) |
| 38 | + * `, |
| 39 | + * ); |
| 40 | + * } |
| 41 | + * ``` |
| 42 | + * |
| 43 | + * See [Denops Documentation](https://vim-denops.github.io/denops-documentation/) |
| 44 | + * or [denops-helloworld.vim](https://github.com/vim-denops/denops-helloworld.vim) |
| 45 | + * for more details. |
| 46 | + * |
| 47 | + * @module |
| 48 | + */ |
| 49 | + |
1 | 50 | // Re-export
|
2 | 51 | export type {
|
3 | 52 | BatchError,
|
|
0 commit comments