Skip to content

Commit 341fa18

Browse files
authored
Merge pull request #241 from vim-denops/exprstr-moduledoc
📝 Add module document to `helper/expr_string`
2 parents c90ab1b + 5526e51 commit 341fa18

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

helper/expr_string.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
/**
2+
* A module to provide expression string function to represents Vim's string constant.
3+
*
4+
* ```typescript
5+
* import type { Denops } from "https://deno.land/x/denops_std@$MODULE_VERSION/mod.ts";
6+
* import * as fn from "https://deno.land/x/denops_std@$MODULE_VERSION/function/mod.ts";
7+
* import {
8+
* type ExprString,
9+
* exprQuote as q,
10+
* useExprString,
11+
* } from "https://deno.land/x/denops_std@$MODULE_VERSION/helper/expr_string.ts";
12+
*
13+
* export async function main(denops: Denops): Promise<void> {
14+
* // Create `ExprString` value with `exprQuote`.
15+
* const vimKeySequence: ExprString = q`\<Cmd>echo 'foo'\<CR>`;
16+
*
17+
* // Use `ExprString` value in `useExprString` block.
18+
* await useExprString(denops, async (denops) => {
19+
* await fn.feedkeys(denops, vimKeySequence)
20+
* await denops.cmd('echo value', { value: q`\U0001F680` })
21+
* });
22+
* }
23+
* ```
24+
*
25+
* @module
26+
*/
27+
128
import type { Context, Denops, Dispatcher, Meta } from "../mod.ts";
229
import is from "https://deno.land/x/unknownutil@v3.16.3/is.ts";
330
import { execute } from "./execute.ts";

0 commit comments

Comments
 (0)