Community
Participate
Working Groups
I20050513-0010 Steps to reproduce: - Enable update imports when pasting - Copy the body of a large size class (eg. JavaEditor) - Create a new class with no members - Paste the body of the other class -> Imports are generated slowly. It seems as every import is immediately applied to the document, thus triggering redraw. Paste should collect the import changes in an import edit and apply once
only one edit is applied.
Tobias, do you have any concrete numbers here ?
My measurements: - Plugin Project with same dependencies as JDT UI - New class DummyEditor - Paste members of class JavaEditor Applying the text edit takes 4.5 s -> Trace shows that, although one edit is applied, the text viewer listens for every document change which causes the slow insertion Attaching trace
Created attachment 21251 [details] Trace
The problem also occurs when pasting without automatically generating immports. As soon as all organize import dialogs to solve ambiguos types have been closed and the text edit is applied to the cu, the described phenomenon happens. However, for the scenario described here, more than one edit is generated. The method ImportsStructure#create(boolean, IProgressMonitor) generates a MultiTextEdit with InsertEdits as children for each of the imports to be generated. Since each one of these child edits triggers redrawing of the widget, it may be worth to start a seqeuential rewrite session or to generate only one edit in ImportsStructure
Martin, would it make sense to set the document into sequential rewrire mode here?
Not critical for 3.1. Should recondider in 3.2.
As of now 'LATER' and 'REMIND' resolutions are no longer supported. Please reopen this bug if it is still valid for you.