I am now customizing a language by writing a BNF file and using the Grammar-kit plug-in to automatically generate a Java file. However, when the number of lines of code in the text is large (for example, 10,000 lines), the psi parsing is time-consuming after each text modification. As a result, code compeletion is very slow, and frame freezing occurs when editing new lines.
After searching for documents, we find that the intellij platform supports incremental parsing. Therefore, some element types are inherited from IReparseableElementType to implement incremental parsing. However, incremental parsing cannot be implemented in many scenarios.
What other methods can be used to improve the psi parsing speed?