We have a shortcut key to jump to method definition from wherever the method is called, i.e. by using Ctrl+leftclick over the method name. But what if I am currently on the method definition and I want to go that location where the method is called or used. Any shortcut for this?
I've tried Ctrl+alt+F7 it did'nt work?
Ctrl+B is used to find the function define, also could be used to find where the function was called. Ok in my idea 15.0.3.
It is usually the same shortcut, unless, you guys redefined it: ctrl-click on a method use takes you to the definition, ctrl-click on the definition finds usages.
Related
errr ... dumb question but i could not find the appropriate settings for this.
When editing code, trying to add a new method in class , as shown below :
Line 355 shows my intended input. When typing it (as shown on line 360), Appcode suggests a bunch of totally irrelevant choices. Can I configure to stop that? I would normally type text[space] and get the annoying textInputContextIdentifier instead of my intent.
It's a bug in completion, track this issue for information about the progress on it.
The possible workaround is do not spent your time on first defining the method signature - try using the method which does not exists in the same way as it's already created, have the red code, press Alt+Enter and select "Create method". Press Enter and have the method stub created in .m file. After it, move cursor to the method signature, press Alt+Enter and have the declaration automatically created in .h file.
I have been reading someone else's matlab code and I don't know how the code structured. I mean I would like to know the hierarchy of functions, which function uses which function. I am reading the code to figure that out but its taking a lot of time.
So is there any other way I can see this hierarchy without reading the whole thing? To be honest it is starting to get confusing. Maybe MatLab has a built in function for that! I found this:
How can I generate a list of function dependencies in MATLAB?
but this doesn't seem to be helpful!
The MATLAB profiler will show you what functions are called by your code (and much more information to boot) and allow you to click through the hierarchy of function calls. You can either call profile on and then run your code, then call profile off and profile viewer, or you can simply call profile viewer and type a single line of code to run in the edit box at the top.
Use the dependency report provided in MATLAB:
http://www.mathworks.co.uk/help/matlab/matlab_prog/identify-dependencies.html
There are also some tools on the File Exchange, such as fdep.
No idea about a function to show visible or depended-upon functions. However the basic rules are:
1) Only the first function in a .m file (normally has to have the same name as the file itself) is visible outside that file.
2) Any function can see any top level (see 1.) function if the file is in the matlab path. Matlab can show you the path so you know where it's hunting.
3) The order of the path is important, the first instance of a function called foo found in the path will be called. Obviously the current directory is at the top of the path.
3) All functions in a given file can see all other functions in that file.
That's the basics. No doubt there are other rules, and possibly exceptions to this. But that understanding generally serves me well.
Obviously the easiest way to work out which function is being called is to click on it in the editor and open it.
One thing I do is simply place in each function at the beginning fprintf("inside function <name>/n"); and at the end of the function fprintf("leaving function <name>/n"); where <name> is the name of the function.
This will give you a very specific list of which function is being called by which function (based on the order that they appear). Another thing like this would be to place fprintf("function <name1> calling function <name2>/n"); so you can be more explicit about which function is being called by which one.
My 'problem' is rather simple but I haven't been able to figure it out - is there a way to make PHPStorm offer "$this->" as an autocomplete option when I start typing "$th" instead of offering "$this" (without the arrow) ? Is there maybe some other solution to this which I don't know about?
You cannot use the autocomplete feature because it does not know beforehand if youre typing '$this' as a function parameter, as a return variable or whatever situation you need it for. The autocomplete will loop the variables available in your current scope - and 'this' is allways within closure of a class function.
As LazyOne states, use a custom template instead, see:
http://www.jetbrains.com/phpstorm/webhelp/creating-and-editing-template-variables.html
Is there any quick way to add a parameter in all methods of a package in eclipse?
If you mean to add a few parameters for one method and after that it'll be updated automatically in all packages , there is. Right click on the method and there is option Refactor -> Change Method signature, here you can add/remove parameters.
See http://www.raymondcamden.com/index.cfm/2009/3/16/Multifile-search-and-replace-in-Eclipse. You will have to modify the instructions there just a tad for your needs:
Instead of telling Eclipse to search for a literal string you will be searching for a regular expression pattern that describes a method call/definition. I'll leave that as an exercise for you ;-)
I have a method which I want to delete. This method is being called from n number of classes. I want to delete this method using refactoring and also make eclipse delete all calls to this method rather than go and clean up in each file. I could not find a straight way to do this from refactor (I am using ganymede)
Delete the method body
Then select the method
Refactor -> Inline
I don't think it can be done through refactoring. You can do a Search and replace using regex though.
CTRL-H to bring up the search replace dialog