Fix gutter icons from extensions

This commit is contained in:
Asher 2019-02-01 12:17:29 -06:00 committed by Kyle Carberry
parent 383c44af07
commit d677a2ee37
No known key found for this signature in database
GPG Key ID: A0409BDB6B0B3EDB
2 changed files with 26 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import "./fill/storageDatabase";
import "./fill/windowsService"; import "./fill/windowsService";
import "./fill/environmentService"; import "./fill/environmentService";
import "./fill/vscodeTextmate"; import "./fill/vscodeTextmate";
import "./fill/codeEditor";
import { PasteAction } from "./fill/paste"; import { PasteAction } from "./fill/paste";
import "./fill/dom"; import "./fill/dom";
import "./vscode.scss"; import "./vscode.scss";

View File

@ -0,0 +1,25 @@
import { join } from "path";
import * as editor from "vs/editor/browser/services/codeEditorServiceImpl";
import { IDecorationRenderOptions } from "vs/editor/common/editorCommon";
/**
* This converts icon paths for decorations to the correct URL.
*/
abstract class CodeEditorServiceImpl extends editor.CodeEditorServiceImpl {
public registerDecorationType(key: string, options: IDecorationRenderOptions, parentTypeKey?: string): void {
super.registerDecorationType(key, options ? {
...options,
gutterIconPath: options.gutterIconPath && options.gutterIconPath.scheme === "file" ? {
...options.gutterIconPath,
scheme: location.protocol.replace(":", ""),
authority: location.host,
path: join("/resource", options.gutterIconPath.path),
} :options.gutterIconPath,
} : {}, parentTypeKey);
}
}
const target = editor as typeof editor;
target.CodeEditorServiceImpl = CodeEditorServiceImpl;