Skip to content

Commit d62aa59

Browse files
committed
Expose internal extensions from processors
1 parent 619213c commit d62aa59

5 files changed

Lines changed: 30 additions & 32 deletions

File tree

denops/fall/processor/collect.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,16 @@ export type CollectProcessorOptions = {
2020
export class CollectProcessor<T extends Detail> implements Disposable {
2121
readonly #controller: AbortController = new AbortController();
2222
readonly #items: IdItem<T>[] = [];
23-
readonly #source: Source<T>;
2423
readonly #threshold: number;
2524
readonly #chunkSize: number;
2625
readonly #chunkInterval: number;
2726
#processing?: Promise<void>;
2827
#paused?: PromiseWithResolvers<void>;
2928

3029
constructor(
31-
source: Source<T>,
30+
readonly source: Source<T>,
3231
options: CollectProcessorOptions = {},
3332
) {
34-
this.#source = source;
3533
this.#threshold = options.threshold ?? THRESHOLD;
3634
this.#chunkSize = options.chunkSize ?? CHUNK_SIZE;
3735
this.#chunkInterval = options.chunkInterval ?? CHUNK_INTERVAL;
@@ -65,7 +63,7 @@ export class CollectProcessor<T extends Detail> implements Disposable {
6563
dispatch({ type: "collect-processor-started" });
6664
const signal = this.#controller.signal;
6765
const iter = take(
68-
this.#source.collect(denops, params, { signal }),
66+
this.source.collect(denops, params, { signal }),
6967
this.#threshold,
7068
);
7169
const update = (chunk: Iterable<IdItem<T>>) => {

denops/fall/processor/match.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export type MatchProcessorOptions = {
2222
};
2323

2424
export class MatchProcessor<T extends Detail> implements Disposable {
25-
readonly #matchers: ItemBelt<Matcher<T>>;
25+
readonly matchers: ItemBelt<Matcher<T>>;
2626
readonly #interval: number;
2727
readonly #threshold: number;
2828
readonly #chunkSize: number;
@@ -37,7 +37,7 @@ export class MatchProcessor<T extends Detail> implements Disposable {
3737
matchers: readonly [Matcher<T>, ...Matcher<T>[]],
3838
options: MatchProcessorOptions = {},
3939
) {
40-
this.#matchers = new ItemBelt(matchers);
40+
this.matchers = new ItemBelt(matchers);
4141
this.#interval = options.interval ?? INTERVAL;
4242
this.#threshold = options.threshold ?? THRESHOLD;
4343
this.#chunkSize = options.chunkSize ?? CHUNK_SIZE;
@@ -46,26 +46,26 @@ export class MatchProcessor<T extends Detail> implements Disposable {
4646
}
4747

4848
get #matcher(): Matcher<T> {
49-
return this.#matchers.current!;
49+
return this.matchers.current!;
5050
}
5151

5252
get items(): IdItem<T>[] {
5353
return this.#items;
5454
}
5555

5656
get matcherCount(): number {
57-
return this.#matchers.count;
57+
return this.matchers.count;
5858
}
5959

6060
get matcherIndex(): number {
61-
return this.#matchers.index;
61+
return this.matchers.index;
6262
}
6363

6464
set matcherIndex(index: number | "$") {
6565
if (index === "$") {
66-
index = this.#matchers.count;
66+
index = this.matchers.count;
6767
}
68-
this.#matchers.index = index;
68+
this.matchers.index = index;
6969
}
7070

7171
#validateAvailability(): void {

denops/fall/processor/preview.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,32 @@ import { dispatch } from "../event.ts";
1010

1111
export class PreviewProcessor<T extends Detail> implements Disposable {
1212
readonly #controller: AbortController = new AbortController();
13-
readonly #previewers: ItemBelt<Previewer<T>>;
13+
readonly previewers: ItemBelt<Previewer<T>>;
1414
#processing?: Promise<void>;
1515
#reserved?: () => void;
1616
#item: PreviewItem | undefined = undefined;
1717

1818
constructor(previewers: readonly Previewer<T>[]) {
19-
this.#previewers = new ItemBelt(previewers);
19+
this.previewers = new ItemBelt(previewers);
2020
}
2121

2222
get #previewer(): Previewer<T> | undefined {
23-
return this.#previewers.current;
23+
return this.previewers.current;
2424
}
2525

2626
get previewerCount(): number {
27-
return this.#previewers.count;
27+
return this.previewers.count;
2828
}
2929

3030
get previewerIndex(): number {
31-
return this.#previewers.index;
31+
return this.previewers.index;
3232
}
3333

3434
set previewerIndex(index: number | "$") {
3535
if (index === "$") {
36-
index = this.#previewers.count;
36+
index = this.previewers.count;
3737
}
38-
this.#previewers.index = index;
38+
this.previewers.index = index;
3939
}
4040

4141
get item(): PreviewItem | undefined {

denops/fall/processor/render.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export type RenderProcessorOptions = {
2020

2121
export class RenderProcessor<T extends Detail> implements Disposable {
2222
readonly #controller: AbortController = new AbortController();
23-
readonly #renderers: ItemBelt<Renderer<T>>;
23+
readonly renderers: ItemBelt<Renderer<T>>;
2424
#height: number;
2525
#scrollOffset: number;
2626
#processing?: Promise<void>;
@@ -34,28 +34,28 @@ export class RenderProcessor<T extends Detail> implements Disposable {
3434
renderers: readonly Renderer<T>[],
3535
options: RenderProcessorOptions = {},
3636
) {
37-
this.#renderers = new ItemBelt(renderers);
37+
this.renderers = new ItemBelt(renderers);
3838
this.#height = options.height ?? HEIGHT;
3939
this.#scrollOffset = options.scrollOffset ?? SCROLL_OFFSET;
4040
}
4141

4242
get #renderer(): Renderer<T> | undefined {
43-
return this.#renderers.current;
43+
return this.renderers.current;
4444
}
4545

4646
get rendererCount(): number {
47-
return this.#renderers.count;
47+
return this.renderers.count;
4848
}
4949

5050
get rendererIndex(): number {
51-
return this.#renderers.index;
51+
return this.renderers.index;
5252
}
5353

5454
set rendererIndex(index: number | "$") {
5555
if (index === "$") {
56-
index = this.#renderers.count;
56+
index = this.renderers.count;
5757
}
58-
this.#renderers.index = index;
58+
this.renderers.index = index;
5959
}
6060

6161
get items() {

denops/fall/processor/sort.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,32 @@ import { dispatch } from "../event.ts";
77

88
export class SortProcessor<T extends Detail> implements Disposable {
99
readonly #controller: AbortController = new AbortController();
10-
readonly #sorters: ItemBelt<Sorter<T>>;
10+
readonly sorters: ItemBelt<Sorter<T>>;
1111
#processing?: Promise<void>;
1212
#reserved?: () => void;
1313
#items: IdItem<T>[] = [];
1414

1515
constructor(sorters: readonly Sorter<T>[]) {
16-
this.#sorters = new ItemBelt(sorters);
16+
this.sorters = new ItemBelt(sorters);
1717
}
1818

1919
get #sorter(): Sorter<T> | undefined {
20-
return this.#sorters.current;
20+
return this.sorters.current;
2121
}
2222

2323
get sorterCount(): number {
24-
return this.#sorters.count;
24+
return this.sorters.count;
2525
}
2626

2727
get sorterIndex(): number {
28-
return this.#sorters.index;
28+
return this.sorters.index;
2929
}
3030

3131
set sorterIndex(index: number | "$") {
3232
if (index === "$") {
33-
index = this.#sorters.count;
33+
index = this.sorters.count;
3434
}
35-
this.#sorters.index = index;
35+
this.sorters.index = index;
3636
}
3737

3838
get items() {

0 commit comments

Comments
 (0)