当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript vscode.MarkdownString类代码示例

本文整理汇总了TypeScript中vscode.MarkdownString的典型用法代码示例。如果您正苦于以下问题:TypeScript MarkdownString类的具体用法?TypeScript MarkdownString怎么用?TypeScript MarkdownString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了MarkdownString类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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

示例4:

 hover => {
   if (!hover) {
     return undefined
   }
   // The server is supposed to return string or { language: string,
   // value: string } or an array of those things, but instead it returns
   // an array of { value: string }. This used to work but with a recent
   // vscode-languageclient the user ends up seeing "[object Object]" as
   // the hover information.
   // We work around this by manually parsing the array of { value: string }
   // into a Hover.
   const contents = hover.contents as { value: string }[]
   let result: vscode.MarkdownString[] = []
   for (let element of contents) {
     let item = new vscode.MarkdownString()
     item.appendCodeblock(element.value, "scala")
     result.push(item)
   }
   return new vscode.Hover(result)
 },
开发者ID:dotty-staging,项目名称:dotty,代码行数:20,代码来源:compat.ts


注:本文中的vscode.MarkdownString类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。