1

I am using JetBrains Rider 2018.1.3 on Win 10 x64 to develop some Unity games.

One of my C# scripts is around 12000 lines of code and the file size is about 550KB. Code inspection is disabled for this file, and adding code to this file is getting really hard, because it does not even show the errors to me. I have to type my code, save, go to unity, wait for compile to complete, and see my errors in unity console. The inspection is working fine on small files.

Is there anything I can do to re-enable this feature for large files?

Here is the image of the error I am getting:

enter image description here

LazyOne
  • 158,824
  • 45
  • 388
  • 391
SJLV
  • 23
  • 3

1 Answers1

0

You can refactor this file to not be insane.

If there are more than one class in this file - split it up so that it's one file per class.

If it's some gigantic class, then use partial to split it up into logical chunks.

I don't think there is an IDE in the world that would be able to read that file in a helpful manner, so I'm afraid you're just going to have to do some cleaning. Reinstalling Rider or changing settings won't help - you've hit (and probably well exceeded) a hard limit. Even if you could change a setting to 'fix' it, you'll be a lot better off in the long term if you split this up.

Pang
  • 9,564
  • 146
  • 81
  • 122
Shadow
  • 8,749
  • 4
  • 47
  • 57
  • thanks for your answer. The file is just 1 class named Service. it has over 100 methods that calls network APIs and processes the response. It is going to be part of an SDK. other devs are going to use this class by calling different methods of the class like _service.getOnlineUsers(), or _service.getGameHighScore, etc. so i cannot split it. this class was originally coded in java, and i was asked to rewrite it in c# for unity. the java class is much bigger (over 20000 lines of code), but in Intellij IDEA community version, the code inspector is doing fine. I wonder why that is. – SJLV Sep 08 '19 at 13:43
  • also the same class works fine in visual studio 2019. but since i`m from a java background myself, i am more comfortable with intellij than visual studio. – SJLV Sep 08 '19 at 13:49
  • 1
    The community versions of jetbrains IDEs tend to do much less introspection than the pro version, so that might be why. And imagine how big, say, the unity SDK would be if they shipped it as one file. Don't do this. If it worries you, then ship the compiled dll. – Shadow Sep 08 '19 at 23:54