Community
Participate
Working Groups
Build Identifier: Typing in big php files (>25k lines of code) that consist of only one <php?> … </php> region is really slow. Main cause is that after every keystroke whole php region of structured editor is updated. This includes examining all php tokens and applying new line styles. In most cases file modification doesn’t cause the php script region to be fully reparsed. Only the affected tokens are reparsed and properly updated. The same approach should be used when it comes to providing line style: only affected tokens should be examined in the process of syntax colouring. Reproducible: Always
Created attachment 209671 [details] Creating text presentation for php script region improved Attached patch modifies the creation of text presentation for a php script region that has not been fully reparsed. Created presentation covers now only affected php tokens, what gives performance boost when typing. Affected classes: IPhpScriptRegion – methods added to get recently updated tokens PhpScriptRegion – methods added to get recently updated tokens. Synchronization on phpTokens added in updateRegion method to avoid concurrent modification exception when the reconciling background thread calls phpTokens.getToken() PhpTokenContainer – synchronized keyword added to few methods to avoid concurrent modification exception PHPStructuredTextViewer – removed line region.setFullReparsed(true); as information that region is not fully reparsed is required in LineStyleProviderForPhp PHPStructuredPresentationReconciler – modified creation of text presentation for damaged php script region that is not fully reparsed StructuredDocumentDamagerRepairer – method returning presentation added which covers only updated php tokens in case when the damage covers whole PHP region and this regions has not been fully reparsed LineStyleProviderForPhp – using only updated php tokens when creating line styles
Created attachment 209682 [details] Creating text presentation for php script region improved II One more improvement in creating text presentation for updated php region. Deals with the case where damaged typed region is smaller than corresponding php script region.
Created attachment 209696 [details] Creating text presentation for php script region improved III A bug fixed in created text presentation range.
Created attachment 209744 [details] Creating text presentation for php script region improved IV Patch improved: more efficient way of creating text presentation in StructuredDocumentDamageRepairer.
fixed by Natalia great work!
Verified. Closing Ilina Stefanova