Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private getDocumentation(
detail: Proto.CompletionEntryDetails,
item: MyCompletionItem
): vscode.MarkdownString | undefined {
const documentation = new vscode.MarkdownString();
if (detail.source) {
const importPath = `'${Previewer.plain(detail.source)}'`;
const autoImportLabel = localize('autoImportLabel', 'Auto import from {0}', importPath);
item.detail = `${autoImportLabel}\n${item.detail}`;
}
Previewer.addMarkdownDocumentation(documentation, detail.documentation, detail.tags);
return documentation.value.length ? documentation : undefined;
}
private formatDocumentation(doc: string): vscode.MarkdownString {
var md = new vscode.MarkdownString(doc);
md.isTrusted = true;
return md;
}
}
let convertDocumentation = function (text: string):MarkdownString {
var regexp = /\(solargraph\:(.*?)\)/g;
var match;
var adjusted: string = text;
while (match = regexp.exec(text)) {
var commandUri = "(command:solargraph._openDocumentUrl?" + encodeURI(JSON.stringify("solargraph:" + match[1])) + ")";
adjusted = adjusted.replace(match[0], commandUri);
}
adjusted = adjusted.replace('<', '<');
adjusted = adjusted.replace('>', '>');
var md = new MarkdownString(adjusted);
md.isTrusted = true;
return md;
}