This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | GsfCodeTemplateProcessor blocks EDT | ||
---|---|---|---|
Product: | editor | Reporter: | jan.kurnatowski |
Component: | Completion & Templates | Assignee: | Dusan Balek <dbalek> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | bfanger, dbcurtis, dstrupl, eliangela, jan.kurnatowski, Kalel, khamberg, marco_bresciani, maulnick, mjanicek, mmetelka, obrejla, s.ryabov, sdedic, UdaySagar |
Priority: | P3 | Keywords: | PERFORMANCE |
Version: | 7.4 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | 201042 |
Attachments: |
nps snapshot
nps snapshot nps snapshot |
Description
jan.kurnatowski
2013-05-30 17:07:36 UTC
Created attachment 135155 [details]
nps snapshot
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) Opinions ? Created attachment 135495 [details]
nps snapshot
autocomplete in php code
Created attachment 135574 [details]
nps snapshot
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. |