How to add background text with a VS Code extension like GitLens?

144 Views Asked by At

I'm trying to add background text for an extension I'm creating like how GitLens does. Is there an API, or function I can use to push text onto the editor?

enter image description here

1

There are 1 best solutions below

0
starball On BEST ANSWER

I believe the related source code is here: https://github.com/gitkraken/vscode-gitlens/blob/main/src/annotations/lineAnnotationController.ts.

It uses the decorations feature of the VS Code API- in particular, text editor decorations. See the window.createTextEditorDecorationType and editor.setDecorations and related functions.