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 141176 - CC not offering constructors
Summary: CC not offering constructors
Status: VERIFIED FIXED
Alias: None
Product: groovy
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: schmidtm
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-22 14:43 UTC by martin_adamek
Modified: 2008-10-30 14:25 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description martin_adamek 2008-07-22 14:43:29 UTC
See Java editor for correct behavior:

String s = new String|
Comment 1 schmidtm 2008-07-23 21:45:38 UTC
This should be fixed with:

http://hg.netbeans.org/main/rev/747f13bffadb
Comment 2 Quality Engineering 2008-07-24 03:59:21 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #341 build
Changeset: http://hg.netbeans.org/main/rev/747f13bffadb
User: Matthias Schmidt <schmidtm@netbeans.org>
Log: Fix for #141176: CC not offering constructors
Comment 3 martin_adamek 2008-07-24 08:54:03 UTC
Ok, now I see constructors in completion, but after I press Enter on some of the items, nothing happens.
Comment 4 schmidtm 2008-07-30 10:37:07 UTC
I've checked in this:

http://hg.netbeans.org/main/rev/67489050bba8

for correct parameter completion for constructors. As a matter of course, plain methods will get this as well in the long-run.

But this won't pre-set the parameters to names, since no codetemplate variables work in groovy - neither programatically via getCustomInsertTemplate() 
nor do they work in the (groovy-)editor in general.

The code-templates have been introduced with: http://hg.netbeans.org/main/rev/86b4c99c2638

Probably, there's something crucial missing to get them work right. I'm kinda at my wits' end here ...

Tor, can you comment?

Comment 5 Torbjorn Norbye 2008-08-29 19:55:13 UTC
Your CodeCompleter method doesn't implement the resolveTemplateVariable() method:

org.netbeans.modules.groovy.editor.completion.CodeCompleter:
    public String resolveTemplateVariable(String variable, CompilationInfo info, int caretOffset, String name, Map
parameters) {
        return "";
    }

Comment 6 Torbjorn Norbye 2008-08-29 19:56:42 UTC
(By the way, try returning null instead of "" if you don't want to support any of your own variables but simply want the
existing values left alone)
Comment 7 schmidtm 2008-09-26 12:21:50 UTC
Ok, this one is fixed with my changes and Petr's fix to resolveTemplateVariable() :

http://hg.netbeans.org/main/rev/1e509344f82c
Comment 8 Lukas Jungmann 2008-10-02 10:49:16 UTC
there are other issues but I'll file them separately, so this one is v.