MCPcopy Create free account
hub / github.com/REditorSupport/vscode-R / getCompletionItems

Function getCompletionItems

src/completions.ts:234–245  ·  view source on GitHub ↗
(names: string[], kind: vscode.CompletionItemKind, detail: string, documentation: vscode.MarkdownString)

Source from the content-addressed store, hash-verified

232}
233
234function getCompletionItems(names: string[], kind: vscode.CompletionItemKind, detail: string, documentation: vscode.MarkdownString): vscode.CompletionItem[] {
235 const len = names.length.toString().length;
236 let index = 0;
237 return names.map((name) => {
238 const item = new vscode.CompletionItem(name, kind);
239 item.detail = detail;
240 item.documentation = documentation;
241 item.sortText = `0-${index.toString().padStart(len, '0')}`;
242 index++;
243 return item;
244 });
245}
246
247function getBracketCompletionItems(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): vscode.CompletionItem[] {
248 const items: vscode.CompletionItem[] = [];

Callers 3

Calls

no outgoing calls

Tested by

no test coverage detected