VSFormatOnSave icon indicating copy to clipboard operation
VSFormatOnSave copied to clipboard

[vs2019] Cached project data is slowly corrupted in C++ project

Open Phlosioneer opened this issue 1 year ago • 0 comments

Over the course of a very long session, I noticed VS2019's understanding of function locations was starting to drift. It was saying that function foo started on line 90 and ended on line 120, when it actually started on line 110 and ended on line 160. It was loosing track of function definition-declaration pairs, and reported that some functions weren't defined.

Deleting the project's .vs folder fixed the problem for now. I suspect that the reformatting on save was not updating some important cached project information stored there.

I haven't tried to create a reproducible test project yet. I have formatting settings that tend to insert a lot more line breaks than I naturally type, which may be contributing to the drift. Line number differences were larger for functions closer to the bottom of files. Functions with "missing" definitions tended to be near the bottom of files as well, but sometimes they were in the middle of the file.

I will try to create a toy project displaying the same issue sometime this week, if I have time. If successful I'll upload the project here.

Visual studio community 2019 version 16.11.19, with Visual C++ 2019 installed Windows 10 Pro 10.0.19045 build 19045 My extensions: Format on Save version 3.2, Fine Code Coverage version 1.1.192 is installed but disabled, github extension for visual studio 2.11.106.19330, Visual Studio Rich Navigation [Preview] 0.1.272.30069, Git Diff Margin 3.12.1, Visual Studio IntelliCode 2.2.1462.13379, NuGetRecommender [Preview] 1.600

Phlosioneer avatar Apr 20 '23 04:04 Phlosioneer