vscode icon indicating copy to clipboard operation
vscode copied to clipboard

How get my own and exsiting CompletionItems in vscode

Open raphael2711 opened this issue 10 years ago • 6 comments

  • VSCode Version:0.10.11
  • OS Version:

I try to get my own and all exsiting Completion Items. I create a plugin and implemant the Completion Items Provider. But my problem now is that i only can see my created item.

provideCompletionItems(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): Promise<vscode.CompletionItem[]> { return new Promise((resolve, reject) => { var completionItems:vscode.CompletionItem[] = [];

      var t3 = new vscode.CompletionItem("myValue");
                t3.kind = vscode.CompletionItemKind.Value;
                t3.insertText = "myValue";
                t3.filterText = "myValue";

              completionItems.push(t3);
                  return resolve(completionItems) ;
                });
}

},".")

raphael2711 avatar Mar 30 '16 08:03 raphael2711

I try to get my own and all exsiting Completion Items.

@raphael2711 By all existing Completion Items do you mean the default textual completions?

jrieken avatar Mar 30 '16 09:03 jrieken

Yes i mean the default textual completions.

raphael2711 avatar Mar 30 '16 18:03 raphael2711

That the current design. When a more specific completion provider returns a non-empty result, less specific completion providers won't be checked anymore. We do that because we assume the provider is more accurate in that case.

jrieken avatar Mar 31 '16 08:03 jrieken

Thank's

raphael2711 avatar Mar 31 '16 10:03 raphael2711

It seems the other completion items are not triggered even if I throw and exception for my trigger character.

atishay avatar May 20 '17 00:05 atishay

@jrieken - Please reopen this: since there are many current providers of completion (own snippets, plugin snippets, intellisense, Typescript completions, plain word completions) as well as the recent favorite: all-autocomplete (plugin that does word completion using all open buffers - addressing missing vscode feature #5312). But when the plugin provides its list of words it completely replaces all the other things (snippets, intellisense, etc).

rnemec avatar May 23 '17 17:05 rnemec