VS Code Decoration API - Hide original text

Viewed 220

I have been digging into VS Code's Extension APIs, particularly the Decoration API. I was wondering if it is possible to replace the appearance of the original text with decorative attachments (i.e. ThemableDecorationAttachment). Here's an example:

// from
foo('frequentlyAppearingUnwieldyLongString')

// to
foo(...)

In which the ... are decoration attachments that hide the original text, while in the actual saved file it shows the full 'frequentlyAppearingUnwieldyLongString'. Is that doable? Or can you only append decoration attachments without changing the original? I am not looking to modify the actual content of the document.

1 Answers

The decoration API can only add decorations on top of the other output, not change it.

Related