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.
code completion for templates shouldn't use expanded text only but should use abbreviation as well. example of template: 1. abbreviation: myclass expanded text: myclass { __construct() {} } code completion will now offer myclass from template when you type mycla(ctr+space) 2. as stated in BUG 183547 you "run into troubles" once you change expanded text on something else then myclass. abbreviation: myclass expanded text: /** * @author PHP Super Trooper Coder */ myclass { __construct() {} } you have no chance to get this in code completion
Makes sense to me. Perhaps CC could offer any template containing the text typed in the editor and not just those that start with the text. A reasonable ordering of these suggestions would be neccessary of course. Or maybe these inexact templates might not be offered in the smart CC. Just random thoughts...
Created attachment 130859 [details] Proposed patch I like to propose a patch for this issue. * completion now works with the abbreviation (as prefix) - as requested * completion based on parameterized text has been removed (made no sense for me - see http://netbeans.org/bugzilla/show_bug.cgi?id=184604#c0 point 2.) * no contexts are supported anymore (made no sense for me too) @NetBeans-Devs: Please review, discuss and commit... Thank you
Created attachment 130860 [details] Patch in action
*** Bug 194734 has been marked as a duplicate of this bug. ***
Comments to the proposed patch: - I'm not sure that using the template abbreviation as the code completion prefix is always better than the expanded text prefix (e.g. typing 'Sy(ctrl+space)' inside method body, code template 'System.out.println()' with abbreviation 'sout' would not be proposed) - as for contexts - makes sense for me not to propose e.g. "protected void method()" outside of a class or inside of another method body. Anyway, I think that the NB integration of code templates and code completion deserves a deeper redesign (currently planned for the next release hopefully).
*** Bug 108180 has been marked as a duplicate of this bug. ***
*** Bug 129278 has been marked as a duplicate of this bug. ***
*** Bug 167108 has been marked as a duplicate of this bug. ***
Fixed in jet-main. Abbreviations should be used together with parameterized text prefix. http://hg.netbeans.org/jet-main/rev/9cde477eea86
Integrated into 'main-golden', will be available in build *201305042300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/9cde477eea86 User: Dusan Balek <dbalek@netbeans.org> Log: Issue #184604: Code completion for templates should use abbreviations as well - fixed.