Skip to content

Commit

Permalink
Add Context for arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Shougo committed Jun 20, 2023
1 parent 954caf1 commit 83d1eeb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
10 changes: 9 additions & 1 deletion denops/ddu/base/column.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { ColumnOptions, DduItem, DduOptions, ItemHighlight } from "../types.ts";
import {
ColumnOptions,
Context,
DduItem,
DduOptions,
ItemHighlight,
} from "../types.ts";
import { Denops } from "../deps.ts";

export type BaseColumnParams = Record<string, unknown>;
Expand All @@ -11,6 +17,7 @@ export type OnInitArguments<Params extends BaseColumnParams> = {

export type GetLengthArguments<Params extends BaseColumnParams> = {
denops: Denops;
context: Context;
options: DduOptions;
columnOptions: ColumnOptions;
columnParams: Params;
Expand All @@ -19,6 +26,7 @@ export type GetLengthArguments<Params extends BaseColumnParams> = {

export type GetTextArguments<Params extends BaseColumnParams> = {
denops: Denops;
context: Context;
options: DduOptions;
columnOptions: ColumnOptions;
columnParams: Params;
Expand Down
9 changes: 8 additions & 1 deletion denops/ddu/base/filter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { DduItem, DduOptions, FilterOptions, SourceOptions } from "../types.ts";
import {
Context,
DduItem,
DduOptions,
FilterOptions,
SourceOptions,
} from "../types.ts";
import { Denops } from "../deps.ts";

export type BaseFilterParams = Record<string, unknown>;
Expand All @@ -17,6 +23,7 @@ export type OnRefreshItemsArguments<Params extends BaseFilterParams> = {

export type FilterArguments<Params extends BaseFilterParams> = {
denops: Denops;
context: Context;
options: DduOptions;
sourceOptions: SourceOptions;
filterOptions: FilterOptions;
Expand Down
3 changes: 3 additions & 0 deletions denops/ddu/ddu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1650,6 +1650,7 @@ export class Ddu {

items = await filter.filter({
denops,
context: this.context,
options: this.options,
sourceOptions,
filterOptions,
Expand Down Expand Up @@ -1688,6 +1689,7 @@ export class Ddu {

const columnLength = await column.getLength({
denops,
context: this.context,
options: this.options,
columnOptions,
columnParams,
Expand All @@ -1697,6 +1699,7 @@ export class Ddu {
for (const item of items) {
const text = await column.getText({
denops,
context: this.context,
options: this.options,
columnOptions,
columnParams,
Expand Down

0 comments on commit 83d1eeb

Please sign in to comment.