This seems to happen when YAML validation is applied to the text files by associating text editors with specific files. In my case there were 2 language servers that would mess things up: BOSH and Concourse (You may have more or less). The simplest way is to go to
Preferences->Language Servers and uncheck anything that has these 2 names. Then select your file and do
Window->Show View->Problems, right click on the error in the
Problems view and delete it.
I'm not sure about implications of disabling these 2 language servers but I'm not interested in the files these seem to be associated with and so far haven't run into any troubles
P.S. These two (Concourse and BOSH) are part of Spring Suit installation that deal with pipelines and tasks. I ended up uninstalling these two