Community
Participate
Working Groups
Build Identifier: Auto indentation takes a lot of time when typing in big php files. Indentation algorithm checks if current statement is a multiline one, i.e. variable assignment like $x = new a(“b”, “c”, “d”,| “e”, “f”); In such case PHPHeuristicScanner searches for unmatched opening bracket. Currently the problem is that the whole document may be searched for opening bracket if the statement is not a multiline one. Scanning is performed from current offset backwards up to the beginning of the document, what is inefficient. Reproducible: Always
Created attachment 209755 [details] Multiline statement indentation improvement - patch Improvements in attached patch: 1. Two new region types have been added to DefaultIndentationStrategy.isRegionTypeAllowedMultiline(regionType) method: PHP_LINE_COMMENT and PHP_STRING. 2. In PHPHeuristicScanner.findOpeningPeer parameter int bound has been added. Scanning backward stops when bound position is reached. 3. DefaultIndentationStrategy.inMultiline() uses findOpeningPeer with proper bound parameter.
fixed by Natalia great work!
Fix applied by Jacek.
Verified. Closing Ilina Stefanova