Rider Cannot Analyze a Source File Because It’s Too Large

Does your project have large auto-generated .cs/.fs/.vb files where some capabilities, such as code highlighting, code completion, or other SWA-dependent features, are unavailable? Is the Solution-Wide Analysis tooltip displaying a message that says “Document size has exceeded the threshold. Right-click to see the options”?

image__1_.png

Is an "OFF" sign displayed in the top right-hand corner of the editor without any highlighting to indicate errors or warnings?

Screenshot_2021-06-18_at_13.30.22.png

If you are experiencing the issues listed above, the file you’re working with is too big for Solution-Wide Analysis to analyze. Rider has a default limit for the maximum size of files it will parse, and the limit is not very high (300 KB by default).
If you encounter this issue and only want to analyze a particular file, you need to enable analysis manually. Hover over the "OFF" icon. In the popup that appears, expand the "Highlight" dropdown and select "All Problems".

Screenshot_2021-06-18_at_13.33.47.png

Then Rider will start performing code analysis for this file.

If you have many large files and you want code analysis to work by default for all of them, you’ll need to increase the file size limit. Please be aware, however, that doing so may affect general IDE performance.

To increase the file size limit, you’ll need to redefine the idea.properties and .DotSettings parameters in the IDE properties files. To do this, add the following properties to the corresponding settings files:

idea.properties 

idea.max.intellisense.filesize=2500

.DotSettings 

<s:Int64 x:Key="/Default/PerformanceThreshold/AnalysisFileSizeThreshold/=CSHARP/@EntryIndexedValue">300000</s:Int64>

Make sure the values you provide for the file size limits are greater than the default values of 2,500 and 300,000.

You can set the file size not only for .cs files, but also for .vb and .fs files. Here are the possible language keys for the settings above: 

  • CSHARP
  • VBASIC
  • F#

Note: for idea.properties, the file size is expressed in  kB while for .DotSettings it is in bytes.

Where to find settings files

idea.properties

Go to Help | Edit Custom Properties.

Please note that changes in idea.properties will take effect only after restarting Rider.

.DotSettings

.DotSettings files store backend settings which are layer-based. There are three possible files where you can set the file size threshold; select the one that suits your needs best:

  • GlobalSettingsStorage.DotSettings (go to Help | Diagnostic Tools -> Special Files and Folders… -> R# Global Settings or Help | Browse Special Paths… -> R# Global Settings in older versions).
  • A team-shared .DotSettings file. The corresponding settings file <SolutionName>.sln.DotSettings is saved in the solution folder.
  • A .DotSettings.user file. The corresponding settings file <SolutionName>.sln.DotSettings.user is saved in the solution folder.

We recommend using the team-shared layer because, if the issue is relevant for you, it probably is also relevant for all your teammates working on the same solution.

For more about Rider settings, see this help page.

 

3 comments
Comment actions Permalink

Are there any other known issues where the analysis will stop but it will not be marked as "stopped" ? I have raised an issue here where null checking seems to stop randomly half way through my file.

https://youtrack.jetbrains.com/issue/RSRP-485382

0
Comment actions Permalink

I can suggest an extremely helpful tool to resolve such issues is LongPathTool. Thank you.

0
Comment actions Permalink

Seems like the GlobalSettingsStorage.DotSettings file gets overridden every time. The solution didn't work with Global settings.
It worked with <SolutionName>.sln.DotSettings though.

0

Please sign in to leave a comment.

Have more questions?

Submit a request