How best to deal with gigantic source code files in Visual Studio

╄→гoц情女王★ 提交于 2019-12-04 09:59:56

Seems like this R# tool (is that Resharper?) is the problem. Can you disable it? Otherwise, changing the file type for the generated code might make sense - presumably, you aren't going to be doing major editing on those files, so losing syntax coloring and other features specific to source files wouldn't be an issue.

I would at least change huge files extention to something like .cpp_gen or .cpp_huge to remove syntax highlighting, outlining etc. and then reassign build tool back to C/C++ compiler tool for them.

WOW!

250 000 lines of code?

you should think not in a machine point of view, but in a human been point of view. Let's say that you want to pass that code to someone else, can you see the time to see what the code does?

Design Patterns were made to deal with this ind stuff, try to start small, refactoring it, then go deeper and start applying more D.P.

you will have less and less lines of code, and Yes, one of the best tricks is to separate into several files according to it's propose.

Assuming you're not hand-editing your generated code. (=BAD IDEA!!)

You could put the generated files in a separate solution that you compile from the command line and then reference those dll's from the project you're working in.

Is the problem when you open the file for editing in Visual Studio? I've noticed that VS editor can be quite slow and inefficient on large files. Also, you could try turning off certain options, e.g. word-wrapping kills my machine for some reason.

Otherwise you could use something else like Textpad with syntax highlighting installed to edit the problematic large source file... not as nice, for sure.

Don't use visual studio. There is too much going on in VS.

Since the file is read only, you wont be using any IDE features (Intellisense, Refactoring tools, formatting).

You will probably get better performance using a simpler application, such as notepad++ for simply viewing the file. Notepad++ will do standard language highlighting if you like color.

Can't you break up the files and use the preprocessor to bring them back together when you compile?

It must be possible somehow to group large chunks of those files in separate libraries. You'd then separate them into several projects. Tried this? What the is the current structure of your source code/ project?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!