Bug 220585 - CElementHyperlinkDetector and DefaultCFoldingStructureProvider can block the UI thread
Summary: CElementHyperlinkDetector and DefaultCFoldingStructureProvider can block the ...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 4.0.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on: 324232
Blocks:
  Show dependency tree
 
Reported: 2008-02-27 10:43 EST by Warren Paul CLA
Modified: 2020-09-04 15:23 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Warren Paul CLA 2008-02-27 10:43:35 EST
This was originally reported in https://bugs.eclipse.org/bugs/show_bug.cgi?id=219834 but not exactly related to that bug so opening a new one.

org.eclipse.cdt.internal.ui.editor.CElementHyperlinkDetector.detectHyperlinks(ITextViewer, IRegion, boolean)

and

org.eclipse.cdt.internal.ui.text.folding.DefaultCFoldingStructureProvider.computeFoldingStructure(FoldingStructureComputationContext)

can both be called from the main UI thread.  They both call org.eclipse.cdt.internal.ui.editor.ASTProvider.runOnAST(ICElement, WAIT_FLAG, IProgressMonitor, ASTRunnable), passing the WAIT_YES flag.

If the TU has not yet been parsed, it will do that parse from the UI thread, "freezing" Eclipse for however long that takes.  Normally this is fast anyway, but for large files it can take some time.  Combine that with another CPU intensive task running (like the indexer), it can really take a while and make the IDE appear to be frozen.

The hyperlink detector is invoked as soon as you press the ctrl key when an editor is in focus.  The folding structure provider is invoked when a new editor window is opened.
Comment 1 Sergey Prigogin CLA 2010-09-01 16:41:50 EDT
*** Bug 324232 has been marked as a duplicate of this bug. ***