Community
Participate
Working Groups
I finally realized that the "empty" CTRL+Space does not show any templates. I think it would be much more helpful if the empty statement show all templates. Example: No line in the editor-> CTRL+Space should display all templates. B-> CTRL+Space shows Browser and Button template. I would assume that this change would be relatively easily, please feel free to guide me to the right class so that I can try to fix that.
Created attachment 230092 [details] Patch Patch attached. I really like this change, I think it makes templates much more visible and useful.
I need to think about it for a while. If we enable this, then I'd definitely also want to enable for keywords.
*** Bug 32971 has been marked as a duplicate of this bug. ***
Thanks Dani for considering this. In my experience in training other Java developers I noticed that must are not aware of the templates, I believe this will give the templates a much higher visibility. I will also blog about this potential feature.
Can you attach that also shows the keywords?
Dani, I'm not sure what you mean with keywords, the switch example from Bug 32971 works as described. Here is my blog post about the potential template feature: http://www.vogella.com/blog/2013/04/25/eclipse-papercut-12-showing-all-templates-in-code-completion/
(In reply to comment #6) > Dani, I'm not sure what you mean with keywords, the switch example from Bug > 32971 works as described. Java keywords, e.g. 'private', 'final', etc.
AFAIK there is currently no code completion for Java keywords. I suggest to handle this via a separate bug. I'm personally also currently sure if code completion for keywords would be desirable.
Typo: I'm personally also currently "NOT" sure if code completion for keywords would be desirable.
Just tested. "Java Non-Type Proposals" seems to be the "Java Keyword Proposals", I never activate that one before. Is the above statement correct?
(In reply to comment #10) > Just tested. "Java Non-Type Proposals" seems to be the "Java Keyword > Proposals", I never activate that one before. > > Is the above statement correct? Do you really think I mention the keyword proposals, if they are not there? ;-) 1. start Eclipse with new workspace 2. paste "class ShowKeywords {}" into 'Package Explorer' 3. inside the braces type p + Ctrl+Space ==> 'private', 'protected' and 'public' appear
"Java Non-Type Proposals" is not active by default, hence I missed that. Also I think the name is not very descriptive. Can I rename this option to "Java Keyword Proposals" in a patch or is there more behind this option? I also see if I can implement the same behavior for Keywords as I did for Templates.
(In reply to comment #12) > "Java Non-Type Proposals" is not active by default, hence I missed that. > Also I think the name is not very descriptive. Can I rename this option to > "Java Keyword Proposals" in a patch or is there more behind this option? No, this is the correct name.
Can I rename this option to > > "Java Keyword Proposals" in a patch or is there more behind this option? > > No, this is the correct name. Thanks. Create patch and bug report for the renaming: Bug 406523
(In reply to comment #14) > Can I rename this option to > > > "Java Keyword Proposals" in a patch or is there more behind this option? > > > > No, this is the correct name. > > Thanks. Create patch and bug report for the renaming: Bug 406523 The answer was "no". The current name is correct.
Sorry for my misunderstanding, answering "no" to an "or" question leaves room for interpretation. I interpreted the "no" to: "or is there more behind this option?". And I felt "this is the correct name." seems to me that the new name is the correct one. Sorry again.
(In reply to comment #16) > Sorry for my misunderstanding, Don't worry. > answering "no" to an "or" question leaves > room for interpretation. Correct, but "The current name is correct." should have clarified the "no".
Lars, please don't change the fields that I set. Thanks. The keyword fix is in JDT Core. Filed bug 406530 with a patch for that. Markus and I like the change where we show the templates and the keywords when there's no prefix. Added an entry to the copyright notice and committed as http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=8784c4cedca248ed848edd5edd1d7c2f3a7741e4
Thanks Dani for the fast application of the fix, I also think this will make templates much more useful. Just for clarification, I rarely change flags actively you set, I typically leave the bug report open in the browser. Looks like the browser does resend the flags if I write a new comment. This time I refreshed the browser before submitting, I hope your flags remain this time.
I suggest to add this to M7 Notes and Newsworthy.
(In reply to comment #20) > I suggest to add this to M7 Notes and Newsworthy. OK. Can you make a patch for http://git.eclipse.org/c/platform/eclipse.platform.news.git/tree/platform/4.3/M7/eclipse-news-M7.html ?
Created attachment 230149 [details] Patch Attached
(In reply to comment #22) > Created attachment 230149 [details] [diff] > Patch > > Attached This patch deletes/corrupts the existing entry. Also, EGit cannot apply binary patches - you have to attach binary data to this bug.
Created attachment 230156 [details] N&N patch Updated patch for N&N
Created attachment 230157 [details] Screensho Screenshot not the best quality. Maybe you create one one Windows with a better resolution.
(In reply to comment #24) > Created attachment 230156 [details] [diff] > N&N patch > > Updated patch for N&N Not sure what you're doing but you can easily see in your patch, that it removes existing content: - Ever encountered a case where content assist adds type parameters for a generic type, but you do not want them - (example: while invoking a static method)? Now, rather than deleting them individually, - you can just delete the '<' and that will remove the entire text up to '>'. + The usage of templates in JDT has been simplified. If you press CTRL+Space without a starting letter you see all templates instead of an empty list. The same is available for keyword completion. + <p><img src="images/templates.png" alt=""/></p> + </td> + </tr> + + <tr id="improssed-template-handling"> + <td class="title">Improved template handling</td> + <td class="content"> +
Created attachment 230170 [details] N&N patch Sorry, next try.
Created attachment 230171 [details] Conflicts Could you please test your next patch before uploading, i.e. apply it via EGit to master? I'm going to loose my patience here.
Understandable that you loose your patience, I was using Git command line as I though it is overkill to setup Eclipse for this trivial change. Sorry that this created a lot of work on your side. Asking for this trivial contribution via Git seemed to have created a lot of unnecessary work in this case on both our sides. Maybe you can paste the text directly into the file? <tr id="improved-template-handling"> <td class="title">Improved template handling</td> <td class="content"> The usage of templates in JDT has been simplified. If you press CTRL+Space without a starting letter you see all templates instead of an empty list. The same functionality is available for keyword completion. <p><img src="images/templates.png" alt=""/></p> </td> </tr> If that is not feasible I can setup Eclipse for this repo or we just skip this item in the N&N.
(In reply to comment #29) > Understandable that you loose your patience, I was using Git command line as > I though it is overkill to setup Eclipse for this trivial change. Sorry that > this created a lot of work on your side. > > Asking for this trivial contribution via Git seemed to have created a lot of > unnecessary work in this case on both our sides. Maybe you can paste the > text directly into the file? > > > <tr id="improved-template-handling"> > <td class="title">Improved template handling</td> > <td class="content"> > The usage of templates in JDT has been simplified. If you press > CTRL+Space without a starting letter you see all templates instead of an > empty list. The same > functionality is available for keyword completion. > <p><img src="images/templates.png" alt=""/></p> > </td> > </tr> > > If that is not feasible I can setup Eclipse for this repo or we just skip > this item in the N&N. (In reply to comment #28) > Created attachment 230171 [details] > Conflicts > > Could you please test your next patch before uploading, i.e. apply it via > EGit to master? I'm going to loose my patience here. Eclipse does not (always) like git am patches, see bug 368358. After manually cutting away the non-patch related stuff, it applies, but I now, used different wording and image.
Thanks Dani