That said, giving something away can still make you money or ensure that your competition does not make money either. This comes down to being a large enough entity to support that strategy, which I personally think Microsoft still is.
If I'm Microsoft, I can give away a "base IDE", enlist volunteers and other companies that can even make a buck themselves for quite some time (and spend some money myself) to kill two birds with one stone.
1) I can bind developers to my platform. From the 2019 annual shareholders report: "Beyond GitHub, we are investing to build the most complete toolchain for developers — independent of language, framework, or cloud. Visual Studio and Visual Studio Code are now the most popular code-editing tools in the world. And TypeScript is one of the fastest-growing programming languages."
2) Where I deem necessary use it to kill off competition by driving them out of business. For quite a few companies, the price point of the IDE that their developers use is important i.e. the choice that companies give their employee is: Use vscode or IntelliJ Community Edition (or something else that's free but we're not paying) and it's very hard to explain developer productivity increases to the bean counters.
I suspect MS will be selling VSCode premium, as I mentioned elsewhere on this thread, they are already maintaining closed components.