Archived
1
0
This repository has been archived on 2024-09-09. You can view files and clone it, but cannot push or open issues or pull requests.
code-server/packages/vscode/src/fill/codeEditor.ts
Asher e770920be0
Remove block padding (blank lines)
Also made a rule for it.
2019-02-05 18:09:04 -06:00

24 lines
915 B
TypeScript

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;