Find usages of lombok generated constructor in Intellij - intellij-idea

I have a class with lombok annotation (either #Value or #Data) and I am looking for an easy way to find usages of the auto generated constructor.
What I can do now is to find a one use of the constructor, put the cursor there and run 'Find usages' command and I get the results I want.
However I would like to do this directly from the class declaration. Is there a way to do that?

I have finally found an acceptable solution to this:
Anywhere in the file invoke "File structure" action (Ctrl + F12 on linux)
Select the desired element (constructor, but also works for Lombok generated builder() method when #Builder is present).
Invoke "Find usages" action (Alt + F7 on linux)

Not as easy as Find Usages, but you could use Structural Search for this. Use the button Copy existing template... and choose new expressions:
new $Constructor$($Argument$)
Edit variables to set the text/regexp of Constructor to your classname.

You can search for usages of the type (the class declaration). IDEA will display the usages grouped by usage type. There you will find "new instance creation".
This works for me with IDEA Ultimate 2016.3 and lombok plugin.

Related

create field in typescript intellij 14.1.2 ultimate from usage

Coming from Eclipse, I like to use a field first (for example) this.fieldname = "value", and then quick fix (control-1) the field declaration into existence without having to type it myself. It would create "private String fieldname;" for example in my class file.
In intellij I thought the same thing was possible across its editors, but I am not able to alt-enter or control space the field into existence. How do I accomplish this? This is for Typescript in Intellij Ultimate. I have enabled the TypeScript compiler per the banner popup.

Intellij Idea - Extract Class

Is possible in Intellij Idea 14 do something like in Eclipse: Refactor : Extract Class?
Or I should do it manually?
Not found proper option in menu, and I am startled option is not available.
Anything that's worth doing in eclipse can be done faster and easier in IntelliJ, but if you're used to eclipse then you'll have to work a little bit to understand IntelliJ's way of doing things.
If you place your cursor somewhere in the java code in question (or on the class name in the project window), the Refactor menu will have an Extract option. Extract Delegate, Interface, and Superclass are the three options that deal directly with classes. These menu options aren't available if your cursor isn't in java class code.
The Interface option extracts an interface, renames your class and makes it implement the interface. The 'Superclass' option extracts a superclass and changes references to refer to it rather than your, now, derived class. The Delegate option simply extracts the methods and properties you choose into a new class.
Place your cursor onto the name of your inner class and press F6.
The refactoring you are looking for is probably extract delegate.

How place getter/setter methods at the bottom of a class definition in intellij

I use the Generate function in the context menu to create my getter and setter methods. But there seems no way to tell Intellij to place the generated methods after the last method in the file ie at the bottom of the class definition. This is possible in Eclipse. Anybody know how to do it automatically in Intellij?
First of all a little hint. IntelliJ is designed to use without a mouse, so I prefer using the keyboard-shortcut Alt + Insert for code generating.
I don't know any possibility to generally define the place for inserting generated code. I recommend to place the cursor there, where you want to insert generated code and then generate it.
If you want to generate getters and setters via Generate menu, the only way is to place cursor at the bottom of your class (or wherever you want them to be)
But if your field is not used yet, there is another option: navigate to the field you need getter/setter for, press Alt+Enter (it calls intentions dialog) and choose "generate getter and setter" option. Then getter and setter will be generated at the bottom of the class (but not below inner classes if any).
settings > code style > java > arrangement
lets you customize the auto formatting options

Is it possible to tell IntelliJ IDEA to automatically invoke toString() on the objects inspected in watches, variables, tool tip windows?

In Eclipse, when a variable is inspected and Eclipse is able to show its value, it does so by calling toString().
IntelliJ IDEA does not do it. Can it be told to?
Thanks.
Settings | Debugger | Data Views:
Using IDEA 13.1:
Preferences -> Debugger -> Data Type Renderers
+(add) new renderer, give it a name
On 'When rendering the node' select option 'Use following expression', type in 'toString()'.
This seems to give me Eclipse-like behaviour.
I'd paste a picture... but don't have enough points. :P
By default Intellij Idea does display the toString() of objects in debug view, unless you explicitly tell it not to in the dialog pointed by CrazyCoder above.
The problem that I have found is that for some crooked reason which only the folks at JetBrains understand, IntelliJ Idea (still as of version 13) will silently ignore the above setting and it will not invoke toString() on classes which do not override the toString() method. Even adding your class in the 'For classes from the list:' will not result in invocation of toString() unless your class explicitly overrides it. So, it appears that IntelliJ Idea will never ever invoke the default toString() method of class Object. I suppose it must be allergic to it.
Right click the variable in the Debug window, and choose "view text". It will open a window showing "toString"

shortcut to goto method definition in rails with textmate

With Netbeans or Eclipse I would Ctrl + click on the function name to go to the method definition. Are there any shortcuts for this in Textmate ?
There's a CTags bundle that will allow something like that. Even though it looks old, it does still work - I use it a lot myself
Ctrl-H is an option to show the API documentation for the current word.
But this doesn't work for any other methods or class that may be defined or included in your project. For those I've written a TextMate Bundle command (you can easily assign it to Ctrl+] for example) that lookup for the definition of the class or method under the caret and displays it in a tooltip, along with the file name and the line where it was find.
Check it out: Add a shortcut to TextMate to lookup a class or method definition in a tooltip
Hope you'll find it useful ;)