This bug was originally marked as duplicate of bug 225603, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.
Build: NetBeans IDE Dev (Build 201305292301)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.21-b01, Java(TM) SE Runtime Environment, 1.7.0_21-b11
OS: Windows 7
jan.kurnatowski: I was editing a PHP file using Ctrl+C, Ctrl+V, Ctrl+Z
Maximum slowness yet reported was 4259 ms, average is 4259
Created attachment 135155 [details]
Calling PM.parseWSF from EDT.
CSL performs parsing in its CodeTemplateProcessor in order to get proper data for updating template values.
1/ The editor parsing loop blocks on behalf of PHP SemanticHighlighter doing some post-processing of Parser.Result, so one of options is to break 'the long part' of the post-processing out from the parser task so that parser will not be blocked.
2/ Although the code template must be inserted in AWT thread into the component, the updateValues could be possibly split to a request processor so the preparation can take an extended time. This would however change the threading model for existing CodeTemplateProcessor implementations - the threading model is not specified IMHO, but at least Java and PHP access JTextComponent from their updateDefaultValues. The change must not be transparent, but an extended interface for (potentially) long-running processors could be crated.
It's not permitted to leak Parser.Result out of the parsing task. CSL could in theory run parsing in a RP in its GsfCompletionItem.defaultSubstituteText, call the CodeCompletionHandler.resolveTemplateVariable in advance outside EDT, save the results and pass them 'around' into the invoked CodeTemplate.insert() running in EDT. I can prototype it; it seems as rather fragile solution, but could fix this particular case.
I am still not 100% about threading model of the CodeTemplate APIs - Milo, please advise.
Still I would opt to both the above additional changes: It's not good to block parsing for such a long time as PHP semantic highlighter does (1), and it would be great to have a systematic support for sophisticated template processors (2)
Created attachment 135495 [details]
autocomplete in php code
Created attachment 135574 [details]
long response time
That problem with long running semantic highlighter in PHP has been fixed already in dev build.
No occurence since 7.3.1. Closing as fixed.