Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return Object.keys(response.arguments).map((k) => {
const argument = response.arguments[k];
const title = argument.title;
const item = vscode_languageserver_1.CompletionItem.create(`<${title}>`);
item.textEdit = vscode_languageserver_1.TextEdit.replace(range, `<${title}>`);
item.kind = vscode_languageserver_1.CompletionItemKind.Variable;
const desc = core_1.IArgument.getCanonicalMemberText(argument);
if (desc) {
item.detail = desc;
}
return item;
});
}
exports.generateMarkdownForArgument = (argument) => {
let relationsStr = "";
if (argument.relations) {
for (let relation of argument.relations) {
const isOutgoing = relation.to === argument;
const relationSymbol = getRelationSymbol(relation.relationType, isOutgoing);
const relationPartner = isOutgoing ? relation.from : relation.to;
const relationPartnerStr = relationPartner.type === core_1.ArgdownTypes.ARGUMENT ? `<${relationPartner.title}>` : `[${relationPartner.title}]`;
relationsStr += `
${relationSymbol} ${relationPartnerStr}`;
}
}
let desc = core_1.IArgument.getCanonicalMemberText(argument);
if (desc) {
desc = ":" + desc;
}
return `
\`\`\`argdown
<${argument.title}>${desc}${relationsStr}
\`\`\``;
};
const relationSymbols = {