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.

Bug 197887 - PHP code templates don't work after save
Summary: PHP code templates don't work after save
Status: VERIFIED WONTFIX
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.0
Hardware: PC Windows Vista
: P1 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on: 198307
Blocks:
  Show dependency tree
 
Reported: 2011-04-20 07:54 UTC by umpirsky
Modified: 2012-05-20 05:32 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Template not working after save (676.50 KB, video/avi)
2011-04-28 12:35 UTC, umpirsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description umpirsky 2011-04-20 07:54:20 UTC
In order to reproduce this bug, set NetBeans editor to expand tabs to spaces (maybe I set it to convert tabs to spaces if such option is available, I'm not sure).

Then try to use some of PHP code templates, for example fnc and press tab, it will work ok, but if you delete generated code and save file, next time you try to type fnc and press tab, the template will not be generated, but one space written instead.

Looks like there is something in save routine that makes template to stop working. 

In addition, if I move to some other line in the script and try template agsain, it will work, but when I save it will stop again. So it works before you save, but after save no.
Comment 1 umpirsky 2011-04-20 07:55:56 UTC
I tested it with NetBEans 7 RC1.
Comment 2 Petr Pisl 2011-04-20 15:56:24 UTC
I can not reproduce the bug and I don't know what is going wrong. How big is the file? Can you reproduce it in new php file? I'm just trying to find out what can be wrong.
Comment 3 Petr Pisl 2011-04-28 12:23:35 UTC
I'm marking this issue as incomplete, waiting for the response. Please reopen the issue, after more info.
Comment 4 umpirsky 2011-04-28 12:35:06 UTC
Created attachment 107994 [details]
Template not working after save

1. Create new PHP file.
2. Type fnc, press tab - template works.
3. Delete generated code
4. Save file.
5. Repeat step 2 - template does not work.
Comment 5 Petr Pisl 2011-04-28 12:54:47 UTC
Now it happens to me as well. It looks like a timing issue and on Vista happens more often than on my Linux system. It happens for me from 20 attempts one time. But the issue is there. Thanks
Comment 6 umpirsky 2011-04-28 12:55:57 UTC
(In reply to comment #5)
> Now it happens to me as well. It looks like a timing issue and on Vista happens
> more often than on my Linux system. It happens for me from 20 attempts one
> time. But the issue is there. Thanks

OK. Good thing is that we reproduced it.
Comment 7 Petr Pisl 2011-05-02 14:08:36 UTC
So far what i have discovered:

There is called a PHP temlate filter, that should decide whether the written letters are a template or not. The PHP template filter decides based on the context where is the abbrev written. For it requires actual parse result and run UserActionTask, where the context should be fined. The problem now is that due to some circumstances the UserActionTask is not started in Parsing API at all. So it looks like an issue with running UserActionsTasks in Parsing API. 

Need to work on this more.
Comment 8 Petr Pisl 2011-05-04 13:00:15 UTC
The fix required changes in parsing api infrastructure. More in issue #198307 that is now fixed. 

The php editor part is now also committed into the web-main.
Comment 9 Quality Engineering 2011-05-05 06:25:36 UTC
Integrated into 'main-golden', will be available in build *201105050000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/fa42cef38899
User: Petr Pisl <ppisl@netbeans.org>
Log: #197887 - PHP code templates don't work after save
Comment 10 Vladimir Riha 2011-05-09 11:07:43 UTC
Verify on:

Product Version: NetBeans IDE Dev (Build 201105090000)
Java: 1.7.0-ea; Java HotSpot(TM) Client VM 21.0-b10
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Comment 11 Petr Pisl 2011-05-17 09:28:29 UTC
For the list of included fixed bugs please check http://wiki.netbeans.org/NetBeans70PatchesInfo
Comment 12 Petr Pisl 2011-05-17 09:31:47 UTC
Transplanted into releases70_fixes

http://hg.netbeans.org/releases/rev/8149d9bcbe52
http://hg.netbeans.org/releases/rev/6523cda6fe79
Comment 13 digitman 2012-05-20 05:32:38 UTC
This bug is still not fixed for me on Windows, version 7.1.2 . The 'expand space to tab' option has no effect on this, it doesn't work whether the option is enabled or not.

Please fix this!! This is very important and its forcing me to not use the latest version of netbeans. In 6.9.1 the templates feature was still working.