File tree Expand file tree Collapse file tree 6 files changed +10
-22
lines changed Expand file tree Collapse file tree 6 files changed +10
-22
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ import type {
1616 ItemPickerParams ,
1717} from "jsr:@vim-fall/std@^0.4.0/config" ;
1818
19- import { ensureAsyncDisposable } from "../lib/dispose.ts" ;
2019import {
2120 getActionPickerParams ,
2221 getGlobalConfig ,
@@ -184,7 +183,6 @@ async function startPicker(
184183 if ( ! action ) {
185184 throw new Error ( `Action "${ actionName } " is not found` ) ;
186185 }
187- await using _guardAction = ensureAsyncDisposable ( action ) ;
188186 const actionParams = {
189187 // for 'submatch' action
190188 _submatchContext : {
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ import type { Detail, IdItem } from "jsr:@vim-fall/std@^0.4.0/item";
55import type { CollectParams , Source } from "jsr:@vim-fall/std@^0.4.0/source" ;
66
77import { Chunker } from "../lib/chunker.ts" ;
8- import { dispose } from "../lib/dispose.ts" ;
98import { dispatch } from "../event.ts" ;
109
1110const THRESHOLD = 100000 ;
@@ -16,7 +15,7 @@ export type CollectProcessorOptions = {
1615 chunkSize ?: number ;
1716} ;
1817
19- export class CollectProcessor < T extends Detail > implements AsyncDisposable {
18+ export class CollectProcessor < T extends Detail > implements Disposable {
2019 readonly #source: Source < T > ;
2120 readonly #threshold: number ;
2221 readonly #chunkSize: number ;
@@ -110,12 +109,11 @@ export class CollectProcessor<T extends Detail> implements AsyncDisposable {
110109 this . #paused = undefined ;
111110 }
112111
113- async [ Symbol . asyncDispose ] ( ) : Promise < void > {
112+ [ Symbol . dispose ] ( ) : void {
114113 try {
115114 this . #controller. abort ( null ) ;
116115 } catch {
117116 // Ignore
118117 }
119- await dispose ( this . #source) ;
120118 }
121119}
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ import type { Detail, IdItem } from "jsr:@vim-fall/std@^0.4.0/item";
55import type { Matcher , MatchParams } from "jsr:@vim-fall/std@^0.4.0/matcher" ;
66
77import { Chunker } from "../lib/chunker.ts" ;
8- import { dispose } from "../lib/dispose.ts" ;
98import { dispatch } from "../event.ts" ;
109
1110const INTERVAL = 0 ;
@@ -19,7 +18,7 @@ export type MatchProcessorOptions = {
1918 incremental ?: boolean ;
2019} ;
2120
22- export class MatchProcessor < T extends Detail > implements AsyncDisposable {
21+ export class MatchProcessor < T extends Detail > implements Disposable {
2322 readonly #matchers: readonly [ Matcher < T > , ...Matcher < T > [ ] ] ;
2423 readonly #interval: number ;
2524 readonly #threshold: number ;
@@ -138,12 +137,11 @@ export class MatchProcessor<T extends Detail> implements AsyncDisposable {
138137 } ) ;
139138 }
140139
141- async [ Symbol . asyncDispose ] ( ) {
140+ [ Symbol . dispose ] ( ) : void {
142141 try {
143142 this . #controller. abort ( null ) ;
144143 } catch {
145144 // Ignore
146145 }
147- await Promise . all ( this . #matchers. map ( ( v ) => dispose ( v ) ) ) ;
148146 }
149147}
Original file line number Diff line number Diff line change @@ -5,10 +5,9 @@ import type {
55 PreviewParams ,
66} from "jsr:@vim-fall/std@^0.4.0/previewer" ;
77
8- import { dispose } from "../lib/dispose.ts" ;
98import { dispatch } from "../event.ts" ;
109
11- export class PreviewProcessor < T extends Detail > implements AsyncDisposable {
10+ export class PreviewProcessor < T extends Detail > implements Disposable {
1211 readonly #previewers: Previewer < T > [ ] ;
1312 readonly #controller: AbortController = new AbortController ( ) ;
1413 #processing?: Promise < void > ;
@@ -94,12 +93,11 @@ export class PreviewProcessor<T extends Detail> implements AsyncDisposable {
9493 } ) ;
9594 }
9695
97- async [ Symbol . asyncDispose ] ( ) {
96+ [ Symbol . dispose ] ( ) : void {
9897 try {
9998 this . #controller. abort ( null ) ;
10099 } catch {
101100 // Ignore
102101 }
103- await Promise . all ( this . #previewers. map ( ( v ) => dispose ( v ) ) ) ;
104102 }
105103}
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import type {
77import type { Renderer } from "jsr:@vim-fall/std@^0.4.0/renderer" ;
88
99import { adjustOffset } from "../lib/adjust_offset.ts" ;
10- import { dispose } from "../lib/dispose.ts" ;
1110import { dispatch } from "../event.ts" ;
1211
1312const HEIGHT = 10 ;
@@ -18,7 +17,7 @@ export type RenderProcessorOptions = {
1817 scrollOffset ?: number ;
1918} ;
2019
21- export class RenderProcessor < T extends Detail > implements AsyncDisposable {
20+ export class RenderProcessor < T extends Detail > implements Disposable {
2221 readonly #renderers: Renderer < T > [ ] ;
2322 #height: number ;
2423 #scrollOffset: number ;
@@ -183,12 +182,11 @@ export class RenderProcessor<T extends Detail> implements AsyncDisposable {
183182 } ) ;
184183 }
185184
186- async [ Symbol . asyncDispose ] ( ) {
185+ [ Symbol . dispose ] ( ) : void {
187186 try {
188187 this . #controller. abort ( null ) ;
189188 } catch {
190189 // Ignore
191190 }
192- await Promise . all ( this . #renderers. map ( ( v ) => dispose ( v ) ) ) ;
193191 }
194192}
Original file line number Diff line number Diff line change @@ -2,10 +2,9 @@ import type { Denops } from "jsr:@denops/std@^7.3.2";
22import type { Detail , IdItem } from "jsr:@vim-fall/std@^0.4.0/item" ;
33import type { Sorter } from "jsr:@vim-fall/std@^0.4.0/sorter" ;
44
5- import { dispose } from "../lib/dispose.ts" ;
65import { dispatch } from "../event.ts" ;
76
8- export class SortProcessor < T extends Detail > implements AsyncDisposable {
7+ export class SortProcessor < T extends Detail > implements Disposable {
98 readonly #sorters: Sorter < T > [ ] ;
109 readonly #controller: AbortController = new AbortController ( ) ;
1110 #processing?: Promise < void > ;
@@ -87,12 +86,11 @@ export class SortProcessor<T extends Detail> implements AsyncDisposable {
8786 } ) ;
8887 }
8988
90- async [ Symbol . asyncDispose ] ( ) {
89+ [ Symbol . dispose ] ( ) : void {
9190 try {
9291 this . #controller. abort ( null ) ;
9392 } catch {
9493 // Ignore
9594 }
96- await Promise . all ( this . #sorters. map ( ( v ) => dispose ( v ) ) ) ;
9795 }
9896}
You can’t perform that action at this time.
0 commit comments