File tree Expand file tree Collapse file tree 6 files changed +68
-17
lines changed Expand file tree Collapse file tree 6 files changed +68
-17
lines changed Original file line number Diff line number Diff line change 32
32
run : deno fmt --check
33
33
- name : Type check
34
34
run : deno task check
35
+ - name : Test doc
36
+ run : deno task test
35
37
36
38
jsr-publish :
37
39
runs-on : ubuntu-latest
Original file line number Diff line number Diff line change
1
+ deno.lock
Original file line number Diff line number Diff line change 1
1
# 🪐 denops_core
2
2
3
3
[ ![ JSR] ( https://jsr.io/badges/@denops/core )] ( https://jsr.io/@denops/core )
4
- [ ![ denoland] ( https://img.shields.io/github/v/release/vim-denops/deno-denops-core?logo=deno&label=denoland )] ( https://deno.land/x/denops_core )
5
- [ ![ deno doc] ( https://doc.deno.land/badge.svg )] ( https://doc.deno.land/https/deno.land/x/denops_core/mod.ts )
6
4
[ ![ test] ( https://github.com/vim-denops/deno-denops/workflows/test/badge.svg )] ( https://github.com/vim-denops/deno-denops/actions?query=workflow%3Atest )
7
5
8
- This module is a fundamental component of [ denops.vim] , an ecosystem for
9
- crafting plugins in [ Deno] for Vim/Neovim .
6
+ This is a core module of [ denops.vim] , an ecosystem for creating Vim/Neovim
7
+ plugin in [ Deno] .
10
8
11
- It's essential to highlight that the recommended practice for most users is to
12
- utilize the [ denops_std] module when developing plugins for [ denops.vim] . The
13
- current module is structured as a foundational layer within [ denops_std] , and
14
- utilizing it directly from plugins is ** strongly discouraged** .
9
+ > [ !WARNING]
10
+ >
11
+ > This module is mainly for internal use. It's ** strongly discouraged** to
12
+ > utilize this module directly from plugins. Use the [ @denops/std ] module
13
+ > instead.
14
+
15
+ ``` ts
16
+ import type { Entrypoint } from " jsr:@denops/core" ;
17
+
18
+ export const main: Entrypoint = (denops ) => {
19
+ // ...
20
+ };
21
+ ```
15
22
16
23
[ deno ] : https://deno.land/
17
24
[ denops.vim ] : https://github.com/vim-denops/denops.vim
18
- [ denops_std ] : https://deno.land/x/denops_std
25
+ [ @denops/std ] : https://jsr.io/@denops/std
26
+
27
+ # License
28
+
29
+ The code follows the MIT license, as stated in [ LICENSE] ( ./LICENSE ) .
30
+ Contributors need to agree that any modifications sent to this repository follow
31
+ the license.
Original file line number Diff line number Diff line change 11
11
"update:commit" : " deno task -q update --commit --pre-commit=fmt,lint"
12
12
},
13
13
"imports" : {
14
- "https://deno.land/x/denops_core@$MODULE_VERSION/ " : " ./"
14
+ "jsr:@denops/core " : " ./mod.ts "
15
15
}
16
16
}
Original file line number Diff line number Diff line change @@ -74,6 +74,11 @@ export interface Denops {
74
74
*/
75
75
readonly context : Record < PropertyKey , unknown > ;
76
76
77
+ /**
78
+ * AbortSignal instance that is triggered when the user invoke `denops#interrupt()`
79
+ */
80
+ readonly interrupted ?: AbortSignal ;
81
+
77
82
/**
78
83
* User-defined API name and method map used to dispatch API requests.
79
84
*/
@@ -142,14 +147,32 @@ export interface Denops {
142
147
/**
143
148
* Denops's entrypoint definition.
144
149
*
145
- * Use this type to ensure the `main` function is properly implemented like
150
+ * Use this type to ensure the `main` function is properly implemented like:
151
+ *
152
+ * ```ts
153
+ * import type { Entrypoint } from "jsr:@denops/core";
154
+ *
155
+ * export const main: Entrypoint = (denops) => {
156
+ * // ...
157
+ * }
158
+ * ```
159
+ *
160
+ * If an `AsyncDisposable` object is returned, resources can be disposed of
161
+ * asynchronously when the plugin is unloaded, like:
146
162
*
147
163
* ```ts
148
- * import type { Entrypoint } from "https://deno.land/x/denops_core@$MODULE_VERSION/mod.ts ";
164
+ * import type { Entrypoint } from "jsr:@denops/core ";
149
165
*
150
166
* export const main: Entrypoint = (denops) => {
151
167
* // ...
168
+ * return {
169
+ * [Symbol.asyncDispose]: async () => {
170
+ * // Dispose resources...
171
+ * }
172
+ * }
152
173
* }
153
174
* ```
154
175
*/
155
- export type Entrypoint = ( denops : Denops ) => void | Promise < void > ;
176
+ export type Entrypoint = (
177
+ denops : Denops ,
178
+ ) => void | AsyncDisposable | Promise < void | AsyncDisposable > ;
Original file line number Diff line number Diff line change 1
1
/**
2
- * This module is a fundamental component of [denops.vim], an ecosystem for crafting plugins in [Deno] for Vim/Neovim.
2
+ * This is a core module of [denops.vim], an ecosystem for creating Vim/Neovim
3
+ * plugin in [Deno].
3
4
*
4
- * It's essential to highlight that the recommended practice for most users is to utilize the [denops_std] module when developing plugins for [denops.vim].
5
- * The current module is structured as a foundational layer within [denops_std], and utilizing it directly from plugins is **strongly discouraged**.
5
+ * > [!WARNING]
6
+ * >
7
+ * > This module is mainly for internal use. It's **strongly discouraged** to
8
+ * > utilize this module directly from plugins. Use the [@denops/std] module
9
+ * > instead.
10
+ *
11
+ * ```ts
12
+ * import type { Entrypoint } from "jsr:@denops/core";
13
+ *
14
+ * export const main: Entrypoint = (denops) => {
15
+ * // ...
16
+ * };
17
+ * ```
6
18
*
7
19
* [deno]: https://deno.land/
8
20
* [denops.vim]: https://github.com/vim-denops/denops.vim
9
- * [denops_std ]: https://deno.land/x/denops_std
21
+ * [@denops/std ]: https://jsr.io/@denops/std
10
22
*
11
23
* @module
12
24
*/
You can’t perform that action at this time.
0 commit comments