Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 364944

Summary: Poor editor(indentation) performance when editing multiline string
Product: z_Archived Reporter: Natalia Bartol <natalia.bartol>
Component: PDTAssignee: PHP Core <php.core-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jacek.pospychala, silviya
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
acceleratorBenchmark.php - PHP file with very long multiline quoted string
none
Indentation performance improvement - patch
jacek.pospychala: iplog+
Wrong indentation case fixed - patch jacek.pospychala: iplog+

Description Natalia Bartol CLA 2011-11-28 07:57:27 EST
Build Identifier: 

Indentation mechanism takes a lot of time when Enter key is hit in the middle of multi line quoted string. 

See attached example acceleratorBenchmark.php file. Hit enter anywhere in the middle/at the end of string.

Reproducible: Always
Comment 1 Natalia Bartol CLA 2011-11-28 07:59:08 EST
Created attachment 207594 [details]
acceleratorBenchmark.php - PHP file with very long multiline quoted string
Comment 2 Natalia Bartol CLA 2011-11-28 08:12:19 EST
Created attachment 207596 [details]
Indentation performance improvement - patch

Attached patch improves:
1. Finding next character position in scanBackward() method (fixed PHPHeuristicScanner.getPartition()).
2. Checking for multiline tokens in DefaultIndentationStrategy.getIndentationBaseLine() has been added.
Comment 3 Zhongwei Zhao CLA 2011-11-28 09:05:02 EST
thanks,Natalia
Comment 4 Natalia Bartol CLA 2011-11-30 14:42:55 EST
Created attachment 207754 [details]
Wrong indentation case fixed - patch

I've found one wrong indentation scenario introduced by previous patch:

In unit tests attached to bug: Bug 365235
Test case arrayStatemets4.pdtt.

Attached patch fixes this issue.
Comment 5 Natalia Bartol CLA 2011-11-30 14:43:41 EST
One incorrect indentation scenario found. Patch attached.
Comment 6 Zhongwei Zhao CLA 2011-12-01 03:59:09 EST
committed,thanks!
Comment 7 Sylvia Tancheva CLA 2012-07-06 08:55:07 EDT
Verified. Closing
Ilina Stefanova