|
@ -11,9 +11,14 @@ import { |
|
|
type Params = {}; |
|
|
type Params = {}; |
|
|
|
|
|
|
|
|
export class Source extends BaseSource<Params> { |
|
|
export class Source extends BaseSource<Params> { |
|
|
|
|
|
static readonly CMAX = 100; |
|
|
|
|
|
c = 0; |
|
|
async gatherCandidates( |
|
|
async gatherCandidates( |
|
|
args: GatherCandidatesArguments<Params>, |
|
|
args: GatherCandidatesArguments<Params>, |
|
|
): Promise<Candidate[]> { |
|
|
): Promise<Candidate[]> { |
|
|
|
|
|
this.c++; |
|
|
|
|
|
if(this.c === Source.CMAX) this.c = 0; |
|
|
|
|
|
|
|
|
const lspservers: string[] = await args.denops.call( |
|
|
const lspservers: string[] = await args.denops.call( |
|
|
"lsp#get_allowed_servers", |
|
|
"lsp#get_allowed_servers", |
|
|
// deno-lint-ignore no-explicit-any
|
|
|
// deno-lint-ignore no-explicit-any
|
|
@ -22,7 +27,7 @@ export class Source extends BaseSource<Params> { |
|
|
return []; |
|
|
return []; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const id = `source/${this.name}`; |
|
|
const id = `source/${this.name}/${this.c}`; |
|
|
void args.denops.call("ddc_vim_lsp#request", lspservers[0], id); |
|
|
void args.denops.call("ddc_vim_lsp#request", lspservers[0], id); |
|
|
|
|
|
|
|
|
const items = await (args as any).onCallback(id, 2000); |
|
|
const items = await (args as any).onCallback(id, 2000); |
|
|