|
|
@ -1,21 +1,21 @@ |
|
|
|
import { |
|
|
|
BaseSource, |
|
|
|
Candidate, |
|
|
|
DdcCompleteItems, |
|
|
|
} from "https://deno.land/x/ddc_vim@v1.4.0/types.ts#^"; |
|
|
|
Item, |
|
|
|
DdcGatherItems, |
|
|
|
} from "https://deno.land/x/ddc_vim@v2.0.0/types.ts#^"; |
|
|
|
|
|
|
|
import { |
|
|
|
GatherCandidatesArguments, |
|
|
|
} from "https://deno.land/x/ddc_vim@v1.4.0/base/source.ts#^"; |
|
|
|
GatherArguments, |
|
|
|
} from "https://deno.land/x/ddc_vim@v2.0.0/base/source.ts#^"; |
|
|
|
|
|
|
|
// deno-lint-ignore ban-types
|
|
|
|
type Params = {}; |
|
|
|
|
|
|
|
export class Source extends BaseSource<Params> { |
|
|
|
private counter = 0; |
|
|
|
async gatherCandidates( |
|
|
|
args: GatherCandidatesArguments<Params>, |
|
|
|
): Promise<DdcCompleteItems> { |
|
|
|
async gather( |
|
|
|
args: GatherArguments<Params>, |
|
|
|
): Promise<DdcGatherItems> { |
|
|
|
this.counter = (this.counter + 1) % 100; |
|
|
|
|
|
|
|
const lspservers: string[] = await args.denops.call( |
|
|
@ -30,7 +30,7 @@ export class Source extends BaseSource<Params> { |
|
|
|
|
|
|
|
const [payload] = await Promise.all([ |
|
|
|
args.onCallback(id) as Promise<{ |
|
|
|
items: Candidate[]; |
|
|
|
items: Item[]; |
|
|
|
isIncomplete: boolean; |
|
|
|
}>, |
|
|
|
args.denops.call("ddc_vim_lsp#request", lspservers[0], id), |
|
|
|