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 150737 - [65cat] Insert code action for constructor heighligts inproperly
Summary: [65cat] Insert code action for constructor heighligts inproperly
Status: CLOSED WONTFIX
Alias: None
Product: python
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Torbjorn Norbye
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-20 15:39 UTC by rajivderas
Modified: 2017-06-23 08:05 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screen shot (15.12 KB, image/png)
2008-10-20 15:41 UTC, rajivderas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rajivderas 2008-10-20 15:39:54 UTC
1) Create a py file
2) In the editor right click and select insert code action and select constructor
3) It will insert code for constructor but it heilights the parameter as well as its colan for refactor rename

see the screen shot

build 78
Comment 1 rajivderas 2008-10-20 15:41:02 UTC
Created attachment 72278 [details]
screen shot
Comment 2 Peter Lam 2008-11-05 01:02:10 UTC
It's actually highlighting the comma before the parameter so starting typing will result in missing the comma.
Comment 3 Torbjorn Norbye 2008-11-05 01:31:32 UTC
This was sort of on purpose - here's the code template:

        <code>def __init__(self${1 default=", parameters"}):
        """${Documentation}"""
        ${cursor}</code>

As you can see, I included the "," in the code template parameter rather than outside like this:

        <code>def __init__(self, ${1 default="parameters"}):
        """${Documentation}"""
        ${cursor}</code>

because I want to make it trivial to -delete- the proposed parameter if you don't want it. The root problem here is that NetBeans doesn't have nested 
parameters the way TextMate does. If it did, I would make ", parameter" the outer part you can either edit or delete, and if you tab into it, you'd edit just 
the parameter. As it is, it's all or nothing, and having to delete the space and comma manually seems annoying, whereas typing ", next" seems okay (after 
all, if you want 2 or more parameters, you also have to type the comma yourself).

Comment 4 Jenselme 2017-06-22 19:28:44 UTC
Templates are still partially broken on the current release but for different reasons. Closing this as old bug. If this is still a thing, please reopen and accept my apologies.
Comment 5 Jiri Kovalsky 2017-06-23 08:05:58 UTC
Thanks for your evaluation Julien. Reporter, if you think your issue is still valid and needs to be addressed, don't hesitate to reopen it with additional information. Closing for now.