How to use the @argdown/core.IEquivalenceClass function in @argdown/core

To help you get started, we’ve selected a few @argdown/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github christianvoigt / argdown / packages / argdown-language-server / dist / providers / utils.js View on Github external
exports.generateMarkdownForStatement = (eqClass) => {
    let relationsStr = "";
    if (eqClass.relations) {
        for (let relation of eqClass.relations) {
            const isOutgoing = relation.to === eqClass;
            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}`;
        }
    }
    return `
\`\`\`argdown
[${eqClass.title}]: ${core_1.IEquivalenceClass.getCanonicalMemberText(eqClass)}${relationsStr}
\`\`\``;
};
exports.generateMarkdownForArgument = (argument) => {
github christianvoigt / argdown / packages / argdown-language-server / dist / providers / provideCompletion.js View on Github external
return Object.keys(response.statements).map((k) => {
            const eqClass = response.statements[k];
            const title = eqClass.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;
            item.detail = core_1.IEquivalenceClass.getCanonicalMemberText(eqClass);
            return item;
        });
    }