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

Bug 386991

Summary: [textmatestyler] Syntax highlighting loops to end of file
Product: [ECD] Orion Reporter: James Brierley <james.brierley>
Component: EditorAssignee: Project Inbox <orion.editor-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: chris.whitty, grant_gayed, james.brierley, ken_walker, mamacdon, Silenio_Quarti
Version: 1.0Keywords: helpwanted
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description James Brierley CLA 2012-08-10 05:20:57 EDT
The while loop in the textmatestyler parse method continues until the end of the file.

Create a very large file (50000~ lines) and there is a significant delay when typing from the start of the file.  This might not be an issue in an IDE for HTML, CSS and JS, but other plugins might require more scalability.
Comment 1 Mark Macdonald CLA 2012-08-16 12:32:51 EDT
Yes, this is a limitation of the current Textmatestyler: the whole file has to be parsed initially. In general the context required by the Textmate format to parse line N depends on lines 0..N-1, but that doesn't mean all that work has to be done in one pass.

So an improvement might be to break the parsing up into chunks, similar to the way the Codemirror styler [1] works. Only the visible portion of the file needs to be parsed right away, and after that the rest can be updated asynchronously. 

[1] https://github.com/eclipse/orion.client/blob/master/bundles/org.eclipse.orion.client.editor/web/orion/editor/mirror.js#L443
Comment 2 Ken Walker CLA 2014-01-16 21:13:51 EST
Grant, is this still an issue?
Comment 3 Grant Gayed CLA 2014-01-17 10:13:27 EST
The behaviour of the TextMate styler would not be affected by Orion's new styling story.  James, which of the following were you trying to display the huge file in:

1. An element containing a scrollbar for scrolling (ie.- an element whose physical bounds would fit within your screen regardless of the length of the content it was responsible for showing), or
2. A huge element containing all of the content up-front that would require the browser-provided scrollbar for scrolling (similar to viewing a really long web page)?
Comment 4 John Arthorne CLA 2015-05-05 16:19:46 EDT
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:


https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html