From 13dd827396330ffbf6cbb3b4fbd2f8607c9f8ad4 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 28 Sep 2016 15:42:33 +0200 Subject: [PATCH] Revert "allow to define gutter and content icons paths as string OR uri, #12111" This reverts commit 6afb0f477a766bf9d6781493f070ca86846afed9. --- .../editor/browser/services/codeEditorServiceImpl.ts | 12 +++--------- src/vs/editor/common/editorCommon.ts | 4 ++-- src/vs/vscode.d.ts | 9 ++++----- src/vs/workbench/api/node/extHostTypeConverters.ts | 2 +- 4 files changed, 10 insertions(+), 17 deletions(-) diff --git a/src/vs/editor/browser/services/codeEditorServiceImpl.ts b/src/vs/editor/browser/services/codeEditorServiceImpl.ts index f4c295a4f09..9169bfce8f5 100644 --- a/src/vs/editor/browser/services/codeEditorServiceImpl.ts +++ b/src/vs/editor/browser/services/codeEditorServiceImpl.ts @@ -301,10 +301,8 @@ class DecorationRenderHelper { if (typeof opts !== 'undefined') { DecorationRenderHelper.collectBorderSettingsCSSText(opts, cssTextArr); - if (typeof opts.contentIconPath === 'string') { - cssTextArr.push(strings.format(this._CSS_MAP.contentIconPath, URI.file(opts.contentIconPath).toString())); - } else if(opts.contentIconPath instanceof URI) { - cssTextArr.push(strings.format(this._CSS_MAP.contentIconPath, opts.contentIconPath.toString())); + if (typeof opts.contentIconPath !== 'undefined') { + cssTextArr.push(strings.format(this._CSS_MAP.contentIconPath, URI.parse(opts.contentIconPath).toString())); } if (typeof opts.contentText !== 'undefined') { let escaped = opts.contentText.replace(/\"/g, '\\\"'); @@ -326,11 +324,7 @@ class DecorationRenderHelper { let cssTextArr = []; if (typeof opts.gutterIconPath !== 'undefined') { - if (typeof opts.gutterIconPath === 'string') { - cssTextArr.push(strings.format(this._CSS_MAP.gutterIconPath, URI.file(opts.gutterIconPath).toString())); - } else { - cssTextArr.push(strings.format(this._CSS_MAP.gutterIconPath, opts.gutterIconPath.toString())); - } + cssTextArr.push(strings.format(this._CSS_MAP.gutterIconPath, URI.parse(opts.gutterIconPath).toString())); if (typeof opts.gutterIconSize !== 'undefined') { cssTextArr.push(strings.format(this._CSS_MAP.gutterIconSize, opts.gutterIconSize)); } diff --git a/src/vs/editor/common/editorCommon.ts b/src/vs/editor/common/editorCommon.ts index f64c674ec54..3dac506d42b 100644 --- a/src/vs/editor/common/editorCommon.ts +++ b/src/vs/editor/common/editorCommon.ts @@ -3788,7 +3788,7 @@ export interface IThemeDecorationRenderOptions { color?: string; letterSpacing?: string; - gutterIconPath?: string | URI; + gutterIconPath?: string; gutterIconSize?: string; overviewRulerColor?: string; @@ -3802,7 +3802,7 @@ export interface IThemeDecorationRenderOptions { */ export interface IContentDecorationRenderOptions { contentText?: string; - contentIconPath?: string | URI; + contentIconPath?: string; border?: string; textDecoration?: string; diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index 6a310d6f2be..f80a8ea9088 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -782,10 +782,9 @@ declare namespace vscode { letterSpacing?: string; /** - * An **absolute path** to an image to be rendered in the gutterIconPath or - * an URI. + * An **absolute path** to an image to be rendered in the gutterIconPath. */ - gutterIconPath?: string | Uri; + gutterIconPath?: string; /** * Specifies the size of the gutter icon. @@ -816,9 +815,9 @@ declare namespace vscode { */ contentText?: string; /** - * An **absolute path** to an image to be rendered in the attachment or an URI. Either an icon or a text can be shown, but not both. + * An **absolute path** to an image to be rendered in the attachment. Either an icon or a text can be shown, but not both. */ - contentIconPath?: string | Uri; + contentIconPath?: string; /** * CSS styling property that will be applied to the decoration attachment. */ diff --git a/src/vs/workbench/api/node/extHostTypeConverters.ts b/src/vs/workbench/api/node/extHostTypeConverters.ts index b81f07900a3..9aebafecfb2 100644 --- a/src/vs/workbench/api/node/extHostTypeConverters.ts +++ b/src/vs/workbench/api/node/extHostTypeConverters.ts @@ -143,7 +143,7 @@ export function fromRangeOrRangeWithMessage(ranges: vscode.Range[] | vscode.Deco return { range: fromRange(r.range), hoverMessage: r.hoverMessage, - renderOptions: /* URI vs Uri*/ r.renderOptions + renderOptions: r.renderOptions }; }); } else { -- GitLab