VS Code Decoration helper functions
npm install vscode-ext-decorationThis module contains a set of helper functions to work with Decorations while developing VS Code extensions.
npm install vscode-ext-decoration
``ts
import { createLineDecoration, createGutterDecoration } from "vscode-ext-decoration";
...
// regular file from disk
const pathIcon = context.asAbsolutePath("images/bookmark.svg");
// building a SVG on the fly
const pathIcon = Uri.parse(
data:image/svg+xml,${encodeURIComponent(
xmlns="http://www.w3.org/2000/svg" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" ,
xmlns:xlink="http://www.w3.org/1999/xlink">
)},
);
const backgroundColor: string = vscode.workspace.getConfiguration("bookmarks").get("backgroundLineColor", "");
const decor = createLineDecoration(backgroundColor, "rgba(0, 255, 0, 0.5)", vscode.OverviewRulerLane.Full, "rgba(21, 126, 251, 0.7)", pathIcon);
``
If you find it useful, please consider supporting it.
![]() | ![]() | ![]() |
MIT © Alessandro Fragnani