简体   繁体   中英

Eclipse Java Editor Templates… why is there no variable for a type?

So here's all of the existing editor template variables:

http://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Fconcepts%2Fconcept-template-variables.htm

Why is there none for a type/object name? There's "var" which will find a variable, but no "type" that will find a variable and evaluate to its type. You can get element types of iterables etc. or "iterable_type" which will only suggest a type that is a parameter of a local iterable.

Is there any other way to do this? If I have a String declared already, I want something like "type" that will evaluate to "String"

There doesn't seem to be any way to do it currently. Open a feature request or bug report with the Eclipse community to maybe have it done.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM