diff --git a/src/vs/editor/browser/services/codeEditorServiceImpl.ts b/src/vs/editor/browser/services/codeEditorServiceImpl.ts index 9169bfce8f5b8b77bb086c3e58f37c6a3540cb39..f4c295a4f09bb0abed7b1faba63b809f2aa178c5 100644 --- a/src/vs/editor/browser/services/codeEditorServiceImpl.ts +++ b/src/vs/editor/browser/services/codeEditorServiceImpl.ts @@ -301,8 +301,10 @@ class DecorationRenderHelper { if (typeof opts !== 'undefined') { DecorationRenderHelper.collectBorderSettingsCSSText(opts, cssTextArr); - if (typeof opts.contentIconPath !== 'undefined') { - cssTextArr.push(strings.format(this._CSS_MAP.contentIconPath, URI.parse(opts.contentIconPath).toString())); + 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.contentText !== 'undefined') { let escaped = opts.contentText.replace(/\"/g, '\\\"'); @@ -324,7 +326,11 @@ class DecorationRenderHelper { let cssTextArr = []; if (typeof opts.gutterIconPath !== 'undefined') { - cssTextArr.push(strings.format(this._CSS_MAP.gutterIconPath, URI.parse(opts.gutterIconPath).toString())); + 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())); + } 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 3dac506d42b536a83b2a3e269b61a5fc71851634..f64c674ec5434983c29a8f05da71a3bda8549249 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; + gutterIconPath?: string | URI; gutterIconSize?: string; overviewRulerColor?: string; @@ -3802,7 +3802,7 @@ export interface IThemeDecorationRenderOptions { */ export interface IContentDecorationRenderOptions { contentText?: string; - contentIconPath?: string; + contentIconPath?: string | URI; border?: string; textDecoration?: string; diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index f80a8ea9088585133d38a2ce768aefe99455c618..6a310d6f2be7af62018069c2907e35e5996c186a 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -782,9 +782,10 @@ declare namespace vscode { letterSpacing?: string; /** - * An **absolute path** to an image to be rendered in the gutterIconPath. + * An **absolute path** to an image to be rendered in the gutterIconPath or + * an URI. */ - gutterIconPath?: string; + gutterIconPath?: string | Uri; /** * Specifies the size of the gutter icon. @@ -815,9 +816,9 @@ declare namespace vscode { */ contentText?: string; /** - * An **absolute path** to an image to be rendered in the attachment. Either an icon or a text can be shown, but not both. + * 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. */ - contentIconPath?: string; + contentIconPath?: string | Uri; /** * 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 9aebafecfb24dbcdd4b7e79deb0e0a5bdab95064..b81f07900a310836ce2f5e4cf932b918cc0bc3a9 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: r.renderOptions + renderOptions: /* URI vs Uri*/ r.renderOptions }; }); } else {