Skip to content

Commit d677a2e

Browse files
code-asherkylecarbs
authored andcommitted
Fix gutter icons from extensions
1 parent 383c44a commit d677a2e

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

packages/vscode/src/client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import "./fill/storageDatabase";
55
import "./fill/windowsService";
66
import "./fill/environmentService";
77
import "./fill/vscodeTextmate";
8+
import "./fill/codeEditor";
89
import { PasteAction } from "./fill/paste";
910
import "./fill/dom";
1011
import "./vscode.scss";
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { join } from "path";
2+
import * as editor from "vs/editor/browser/services/codeEditorServiceImpl";
3+
import { IDecorationRenderOptions } from "vs/editor/common/editorCommon";
4+
5+
/**
6+
* This converts icon paths for decorations to the correct URL.
7+
*/
8+
abstract class CodeEditorServiceImpl extends editor.CodeEditorServiceImpl {
9+
10+
public registerDecorationType(key: string, options: IDecorationRenderOptions, parentTypeKey?: string): void {
11+
super.registerDecorationType(key, options ? {
12+
...options,
13+
gutterIconPath: options.gutterIconPath && options.gutterIconPath.scheme === "file" ? {
14+
...options.gutterIconPath,
15+
scheme: location.protocol.replace(":", ""),
16+
authority: location.host,
17+
path: join("/resource", options.gutterIconPath.path),
18+
} :options.gutterIconPath,
19+
} : {}, parentTypeKey);
20+
}
21+
22+
}
23+
24+
const target = editor as typeof editor;
25+
target.CodeEditorServiceImpl = CodeEditorServiceImpl;

0 commit comments

Comments
 (0)