microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.81k stars 29.12k forks source link

API to hide arbitrary text and show a placeholder #220118

Open Chaxwell opened 3 months ago

Chaxwell commented 3 months ago

Feature description

Original

<h3>{{ 'mytext.to.be.replaced' }}</h3>

Placeholder (with some kind of visual indication that this is a replacement)

<h3>{{ 'Text replacement' }}</h3>

My use case

I'm developing an extension that reads YAML files, which contain key/values for translations, such as in this example :

app:
    invoice:
        issued: "Issued"
        number: "Invoice #"

and then provides autocomplete based on the keys, displays the translation in a hover dialog and in the description dialog, and provides a link to the line in the file where this translation is located That would be awesome to be able to directly display "Invoice #" where there is a text "app.invoice.number"

I am willing to make a contribution or at least take a look at it. I would greatly appreciate some pointers to where I can start, and to know if it is even possible.

Related old issue #45393

Chaxwell commented 3 months ago

@aeschli if you're allowing me to tag you since it looks like it's your domain of expertise :)