automated variable highlighting/ code highlighting doesn't work anymore

Dear community,
I am working on a huge prototype-project.I am creating a GUI using Guide (I know that this is not recommended). After some changes (added some buttons and filled their functions with life) i noticed that the Editor looks different...
After having a second look i noticed that no variables are highlighted anymore. Also the global variables are not turquise anymore. Also the backround is not yellow anymore, as it should be when you are seperation sections with "%%"
Here a screenshot of the previous and actual state:
usually this happens if there is a syntax error (e.g. if I am missing an "end" in a loop) or if I wrongly put a "return". But this time it might not be the case. The code and every function runs. No syntax error... I used the comparison function of matlab and checked every line I changed... but dind't find anything suspicious. Also the yellow "warnings" on the right side of the IDE don't help (also, there is no red "error").
Do you guys have any idea? Could I provide you any further information that would help?
greetings
Marten

3 comentarios

What is the size of the .m file, in bytes?
Release notes:
Starting in R2019b, program files larger than approximately 128 MB do not open or run. For files that contain only code (for example, .m and .p files), this limit affects the file size. For files that store more than just code (for example, .mlx files), it affects the size of the code. Running statements larger than 128 MB, either directly in the Command Window or using the eval function, also is not supported. In addition, code with high levels of complexity, such as a large number of deeply nested if statements, is not supported.
Large program file or statement sizes could result in unpredictable behavior and often occurred when using large portions of code (for example, over 500 lines) to define variables with constant values. To decrease the size of program files, consider defining the variables and saving them in a data file (for example, a MAT-file or .csv file). Then you can load the variables instead of executing code to generate them. This adjustment not only decreases the file size of your program but also can increase performance.
thanks for the quick answer. The main file has ~25.000 lines of code and ~1MB size.
Oh okay... because of your answer I tried the following:
I used an older version of the code (~23.000 lines). And just added a bunch of copy & paste lines to get over 25.000 lines... and all of the sudden the highlighting doesn't work anymore. Even after saving, restarting and reloading... so the size might be the problem... thank you!
I guess the prototype is too big now :D

Iniciar sesión para comentar.

 Respuesta aceptada

I have a vague memory that the Code Analyzer (used to be called mlint https://www.mathworks.com/help/matlab/ref/mlint.html ) has a limit on the number of lines it analyzes automatically, and that was the same limit on what it could analyze for code folding.
Current non-interactive tool is checkcode()
and see also the code analyzer report (which creates interactive content iirc)
I do not know if there is a way of increasing the limit on the number of lines interactively analyzed; I would expect checkcode() to be able to handle larger files non-interactively.
Yes, that is a hint that you might not be getting errors and warnings that you should be getting when you are using more than 25K lines.

Más respuestas (0)

Categorías

Preguntada:

el 19 de Jun. de 2021

Respondida:

el 19 de Jun. de 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by