Browse Source

Catch up with the latest ddc api

pull/13/head
matsui54 3 years ago
parent
commit
4d576bc4f9
  1. 18
      denops/@ddc-sources/vim-lsp.ts

18
denops/@ddc-sources/vim-lsp.ts

@ -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),

Loading…
Cancel
Save