Does your project have large auto-generated .cs/.fs/.vb/.cpp 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”?
Is an "OFF" sign displayed in the top right-hand corner of the editor without any highlighting to indicate errors or warnings?
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".
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:
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:
- CPP (since 2021.3)
Note: for idea.properties, the file size is expressed in kB while for .DotSettings it is in bytes.
Where to find settings files
Go to Help | Edit Custom Properties.
Please note that changes in idea.properties will take effect only after restarting Rider.
.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.