There is a plugin for VSCode called SpellRight which does this correctly.
It’s a bit limited regarding user-provided dictionary additions, though.
It also works with the LaTeX Workshop-plugin which allows you to write latex documents directly in VSCode.