FWIW, I had a file with 165k lines of code (~ 6 MB) that I created using my tool (it was intended to load some test data).
On Linux (Ubuntu 16.04), I got a System.AccessViolationException when I tried to use this type in a file.
Thus, it would seem that there is indeed some limit.
I should mention that it used .NET Core 2.0
source share