ReSharper C++ code highlighting not working for large files


Been using ReSharper in Visual Studio 2022 for a year now but can't figure out how to get it to offer highlighting for some of the larger files in our solution (e.g. one that is ~40k lines). Analysing the solution flags the expected errors, but any in-editor highlighting, underlining, greying out - doesn't apply.

I see there is a setting for Rider: but that option, which I have set as `<s:Int64 x:Key="/Default/PerformanceThreshold/AnalysisFileSizeThreshold/=Cpp/@EntryIndexedValue">100000</s:Int64>` in my DotSettings file - seems to have no effect. Is there a way to configure this for C++ code?



For files that exceed the limit the analysis status indicator should show the “paused” icon.

In the context menu you can click “Resume analysis” to turn on the analysis. After that R# should remember that file analysis in this file is enabled.




Thanks - yeah, that works for now. 

Are there any plans for a better way to achieve this, similar to what that link suggests we can do in Rider? Having to have every engineer change these settings, for a number of files and on all of their dev machines, isn't exactly the workflow I'd like. It would be nice if we can just edit this limitation along with all of the other shared configuration options that are in the DotSettings file in source control.


When you enable file analysis in the file R# saves a flag in the .DotSettings.user file. You can copy it to the corresponding .DotSettings file to share it with your colleagues.

The file size setting from the linked article should work as well. R# looks at file size in bytes, not in lines. In your first message you wrote that you set the setting to 100000, so you've actually reduced it from the default 300000 value.


Ah, thanks! Is there an upper limit to this? I can see it working for ~1Mb files now but I have a handful of larger files (up to 4Mb, unfortunately) which it just seems to give up on.


There's also a setting to turn off building AST on huge files, 2MB by default:

<s:Int64 x:Key="/Default/PerformanceThreshold/BuildPsiFileSizeThreshold/=Cpp/@EntryIndexedValue">2000000</s:Int64>

We don't expect R# to work well (if at all) on files of this size.


Please sign in to leave a comment.