Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 562815 - Better variable name for postfix template var
Summary: Better variable name for postfix template var
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.14   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.16 M3   Edit
Assignee: Roland Grunberg CLA
QA Contact: Roland Grunberg CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 560385
  Show dependency tree
 
Reported: 2020-05-05 05:13 EDT by Lars Vogel CLA
Modified: 2020-05-19 13:07 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2020-05-05 05:13:36 EDT
Currently the var postfix template suggest "name" for the variable. Maybe this can be adjusted to the use the name as Ctrl+2, L?

Postfix: 

List<MWindowElement> name = stack.getChildren();

Ctrl+2, L: 

List<MWindowElement> children = stack.getChildren();
Comment 1 Roland Grunberg CLA 2020-05-06 12:56:19 EDT
This actually ends up using NameResolver for the name, which delegates to StubUtility.getVariableNameSuggestions(..), which takes 'stack.getChildren()' and ends up suggesting 'name'. Would be interesting to see how this varies from 'Assign to local variable'.
Comment 2 Eclipse Genie CLA 2020-05-06 13:46:28 EDT
New Gerrit change created: https://git.eclipse.org/r/162579
Comment 4 Lars Vogel CLA 2020-05-11 15:10:02 EDT
Cooool. Thanks, Roland.
Comment 5 Lars Vogel CLA 2020-05-18 07:28:24 EDT
Verified in Eclipse SDK
Version: 2020-06 (4.16)
Build id: I20200515-1930
OS: Linux, v.5.4.0-29-generic, x86_64 / gtk 3.24.18, WebKit 2.28.2
Java version: 1.8.0_252