Region and EndRegion not in sync with Expand and Contract button in IDE

image

In one of my app files, the IDE is out of sync with the !Region and !EndRegion tags. It also jumps to the wrong line when I click on an error after a compile.

Any idea how to fix this?