Move isMarkdownString to extHostTypes MarkdownString

This commit is contained in:
Alex Ross
2020-07-13 11:52:17 +02:00
parent fc8e4779d1
commit 97bf8e14f5
2 changed files with 9 additions and 6 deletions

View File

@@ -13,7 +13,7 @@ import { ExtHostTreeViewsShape, MainThreadTreeViewsShape } from './extHost.proto
import { ITreeItem, TreeViewItemHandleArg, ITreeItemLabel, IRevealOptions } from 'vs/workbench/common/views';
import { ExtHostCommands, CommandsConverter } from 'vs/workbench/api/common/extHostCommands';
import { asPromise } from 'vs/base/common/async';
import { TreeItemCollapsibleState, ThemeIcon } from 'vs/workbench/api/common/extHostTypes';
import { TreeItemCollapsibleState, ThemeIcon, MarkdownString as MarkdownStringType } from 'vs/workbench/api/common/extHostTypes';
import { isUndefinedOrNull, isString } from 'vs/base/common/types';
import { equals, coalesce } from 'vs/base/common/arrays';
import { ILogService } from 'vs/platform/log/common/log';
@@ -24,10 +24,6 @@ import { IMarkdownString } from 'vs/base/common/htmlContent';
type TreeItemHandle = string;
function isMarkdownString(value: any): value is vscode.MarkdownString {
return (value !== undefined) && value.appendCodeblock && value.appendMarkdown && value.appendText && (value.value !== undefined);
}
function toTreeItemLabel(label: any, extension: IExtensionDescription): ITreeItemLabel | undefined {
if (isString(label)) {
return { label };
@@ -531,7 +527,7 @@ class ExtHostTreeView<T> extends Disposable {
}
private getTooltip(tooltip?: string | vscode.MarkdownString): string | IMarkdownString | undefined {
if (isMarkdownString(tooltip)) {
if (MarkdownStringType.isMarkdownString(tooltip)) {
checkProposedApiEnabled(this.extension);
return MarkdownString.from(tooltip);
}