當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript MarkdownString.appendMarkdown方法代碼示例

本文整理匯總了TypeScript中vscode.MarkdownString.appendMarkdown方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript MarkdownString.appendMarkdown方法的具體用法?TypeScript MarkdownString.appendMarkdown怎麽用?TypeScript MarkdownString.appendMarkdown使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在vscode.MarkdownString的用法示例。


在下文中一共展示了MarkdownString.appendMarkdown方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: MarkdownString

		return this.client.execute('completionEntryDetails', args, token).then((response) => {
			const details = response.body;
			if (!details || !details.length || !details[0]) {
				return item;
			}
			const detail = details[0];
			item.detail = Previewer.plain(detail.displayParts);
			const documentation = new MarkdownString();
			if (item.source) {
				documentation.appendMarkdown(localize('autoImportLabel', 'Auto import from \'{0}\'', item.source));
				documentation.appendMarkdown('\n\n');
			}

			Previewer.addmarkdownDocumentation(documentation, detail.documentation, detail.tags);
			item.documentation = documentation;

			if (detail.codeActions && detail.codeActions.length) {
				item.command = {
					title: '',
					command: this.commandId,
					arguments: [filepath, detail.codeActions]
				};
			}

			if (detail && item.useCodeSnippetsOnMethodSuggest && (item.kind === CompletionItemKind.Function || item.kind === CompletionItemKind.Method)) {
				return this.isValidFunctionCompletionContext(filepath, item.position).then(shouldCompleteFunction => {
					if (shouldCompleteFunction) {
						item.insertText = this.snippetForFunctionCall(detail);
					}
					return item;
				});
			}

			return item;
		}, () => {
開發者ID:gokulakrishna9,項目名稱:vscode,代碼行數:35,代碼來源:completionItemProvider.ts

示例2: markdownDocumentation

export function markdownDocumentation(
	documentation: Proto.SymbolDisplayPart[],
	tags: Proto.JSDocTagInfo[]
): MarkdownString {
	const out = new MarkdownString();
	out.appendMarkdown(plain(documentation));
	const tagsPreview = tagsMarkdownPreview(tags);
	if (tagsPreview) {
		out.appendMarkdown('\n\n' + tagsPreview);
	}
	return out;
}
開發者ID:elibarzilay,項目名稱:vscode,代碼行數:12,代碼來源:previewer.ts

示例3: Range

		cachedScriptsMap!.forEach((value, key) => {
			let start = document.positionAt(value[0]);
			let end = document.positionAt(value[0] + value[1]);
			let range = new Range(start, end);

			if (range.contains(position)) {
				let contents: MarkdownString = new MarkdownString();
				contents.isTrusted = true;
				contents.appendMarkdown(this.createRunScriptMarkdown(key, document.uri));

				let debugArgs = extractDebugArgFromScript(value[2]);
				if (debugArgs) {
					contents.appendMarkdown(this.createDebugScriptMarkdown(key, document.uri, debugArgs[0], debugArgs[1]));
				}
				hover = new Hover(contents);
			}
		});
開發者ID:developers23,項目名稱:vscode,代碼行數:17,代碼來源:scriptHover.ts


注:本文中的vscode.MarkdownString.appendMarkdown方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。