How to dinamically change document text on a VSCode Extension

Viewed 241

I am currently working on a vscode extension, built with typescript, but I'm having some problems with TextEdit as there is little to no information online. What I want to do is the following:

If a user types 1 I want it to be changed to <int> (this is just an example). This change should be checked whenever a user inputs any character into the text document. To do this, I am using connection.onDidChangeContent() and trying to return a TextEdit[], but nothing changes in the user's text document. If I use connection.onDocumentFormatting(), I am able to return a TextEdit[] that successfully changes the user's document. How can I accomplish this with the OnDidChangeContent() function? Is it possible to do so?

Thank you

0 Answers
Related