Bug 565534 - [postifx] sysout/syserr postfix completion on variable
Summary: [postifx] sysout/syserr postfix completion on variable
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.16   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2020-07-25 03:29 EDT by Mickael Istria CLA
Modified: 2020-08-18 05:42 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 Mickael Istria CLA 2020-07-25 03:29:25 EDT
I'd like to easily be able to insert a trace showing me that variable and its value.
Proposal: some .syserr and .sysout postfix completion on expressions, so that
`myVar.` could propose `syserr` as completion and then replace `myVar.` by `System.err.println("myVar=" + myVar)`; and similarly for expressions `someObject.getInfo().x.` could be replaced by `System.err.println("someObject.getInfo().x=" + someObject.getInfo().x)`.
Comment 1 Roland Grunberg CLA 2020-07-27 14:44:24 EDT
We currently have 'sysout' (but could also add a syserr) which works on an expression whose type is/returns String. We could probably lift this restriction to allow Objects and include the name of the expression as you've described. This would be a nice improvement to the current functionality.
Comment 2 Mickael Istria CLA 2020-07-28 02:59:06 EDT
Would it also be possible to add this for base types like int/float/char ?
Comment 3 Lars Vogel CLA 2020-08-18 05:42:46 EDT
(In reply to Roland Grunberg from comment #1)
> We could probably lift this restriction to allow Objects 

+1