tools / IDE that highlight function definition on which files [just wondering] - ide

is there already any IDE / tools that if you highlight a function name, it will open the file where that function is defined on the next window so we could understaand what that function does?
you know just wondering.

Visual Studio has a "Go To Definition" feature available in its text editor. When the cursor is on a varible, function, class, and so on, you can right-click and select the "Go To Definition" menu item and it will take you to where the function is defined. If the definition is part of the .NET Framework, the feature will "jump" to the definition in the Object Browser for VB.NET projects or to the "meta-data" of C# projects

Are there any IDEs that don't do this? Every IDE I have ever used had this feature: several Smalltalk IDEs, Hopscotch, several Lisp IDEs, NetBeans, Eclipse, Visual Studio, VisualAge for Java Micro Edition, VisualAge for Java, VisualAge for Smalltalk. Even many text editors can do it: TextMate, Vim, Emacs, Notepad++.

By using something like ctags this is definitely possible, provided of course your favourite editor also has support for ctags. The good thing about ctags is that with a bit of tweaking it can be made to work with almost any language.

In Netbeans you highlight the function -> right button click -> Navigate -> Go To Declaration and it will open the file where this function has been created.

I use Eclipse as my Java IDE and find the F3 key to be the quickest way to open the declaration. Good description of this functionality below (from here):
F3: Open declaration. Alternatively,
you can click on the Declaration tab
(in the Java perspective, go to
Window, then Show View, then
Declaration). This key shows entire
method declarations in the declaration
pane when you click on a method call
in the code.
I haven't used this with other languages editors in Eclipse (Perspectives in Eclipse), but I'd guess the functionality is similar.

Related

CLion code navigation with C++ doesn't work

I've used AppCode (Intellij C++/ObjC IDE that replaces Xcode) for a while and really gotten used to being able to Ctrl+Click on any identifier to get to its definition/decleration.
Now on a new work place, I'm using CLion for a somewhat larger code base and Ctrl+Click hardly ever works. It only seem to work when the identifier is in the same file.
Is there anything I need to setup for this to work correctly? CLion seem to index the code successfully and doing text searches works fine.
You need to use import project functionality of CLion from File -> Import Project and give ok for CMakeLists.txt file automatic creation. Never mind the file is for CMake, you can build your project with other tools too, but CLion uses it for the dependencies.
Then append in the beginning of that file a line stating:
include_directories(.)
After that go to File -> Settings and there search for Keymap from the left and after that on right, right below the word "keymap" there is a selection element for taking for example Eclipse default keymapping in use and there you have at least (I tested only it) the ctrl + click functionality working like charm!!
kudos about the include_directories(.) goes to this question: CLion indexer does not resolve some includes in the project directory
You need to press ctrl + alt + shift + n.
And after pressing it a dialog box will appear to enter your variable/function name and click enter.
Tip: Filter the result for a better experience. Filter option is present on right side of the dialog box.
To get a quick peek of function/variable definition press ctrl + q while focusing on the variable or function.
To get the detailed or full definition of function press ctrl + shift + i while focusing on the variable or function.
I just looked at one of my more complicated teaching examples with multiple header/source files where this would come up.
What I see is that ctl-click (and the red/green arrows in the gutter) does work only in the same file. But I can right-click on a method from another file and choose to go to either the declaration (in header) or definition (in cpp).
The hotkeys to do this are not ctl-click. But you can remap hotkeys in IntelliJ ides, so you may be able to come up with hotkey combinations that don't seem too awkward to you.
What helped me was to run File > New CMake Project from Sources
Until that point, Ctrl+click in CLion would go to the definitions, but wouldn't find any usages.

How to make auto completion in WebStorm (*.js) and IntelliJ (*.go) work the same

In WebStorm I can type something like
document.gEBI
press tab key, and it'll autocomplete to
document.getElementById()
But when I do the similar thing in IntelliJ
fmt.Prl
Auto completion doesn't work (the desired result fmt.Println()) at all, it works only if all the letters match strictly in order.
Is it possible to enable this functionality in IntelliJ? I've imported all the settings from WebStorm.
These Tab key shortcuts aren't part of the auto-complete system the Jetbrains use for all their IDEs as LazyOne says, they are actually part of the template-invocation system.
The auto-complete functionality is built into the shortcut: Ctrl+Space.
I suggest looking up the template invocation for .Println() in the settings, Jetbrains documentation, or raising a ticket with Jetbrains on YouTrack for clearer documenation/control over template-invocation.

Flash Builder MXML auto-brackets, quotes etc

Any idea what is the setting in Flash Builder 4.5/4.6 to automatically close the "Strings", [brackets], {Braces} for the MXML
code as in eclipse for the Java code ?
To the best of my knowledge, there's no setting in Flash Builder to auto-insert closing quotes/brackets/braces. Eclipse generally makes this feature language-specific, so it has to be specifically implemented for MXML – the feature seen in other languages like Java doesn't automatically "carry over" to MXML, AS, etc.
I looked into whether the "Code Templates" feature could be used to give you a quick shortcut for inserting pairs like {}, but it doesn't look like that will work.
However, you can get "" auto-inserted for MXML attributes: if you use autocomplete to enter the attribute name, the ="" will be automatically generated after it. (If this isn't working for you, check Preferences > Flash Builder > Editors > MXML Code and make sure "Insert closing quote when completing attributes" is checked).
I use to have the same issue closing braquets, here is the solution for flash builder 4.6, to autoclose strings maybe isn't possible:
In your MXML code editor press mouse rigth click and this menu should open this menu:
Select Preferences... and you can select your options in this window:

intellij shortcut for creating method stub

I've recently switched over to intellij for scala development.
I'm having trouble finding the following shortcut:
In eclipse, I could type a method call e.g.
method("hello", 1)
and press <command>1 to have eclipse popup a suggestion to let me create a method stub.
Is there such a shortcut in intellij?
Use Alt+Enter (Show Intention Actions in Settings | Keymap).
Verified, works fine in IDEA 11.0.1 with the current Scala plug-in:
Activate Type aware highlighting (See the [T] symbol in the image) and
Set Highlighting level to Inspections
Then it is possible to use alt + enter (similar to Ctrl+1 in Eclipse) to show menu, which has create method option.
Why isn't it enabled by default?
The feature is in beta (or maybe in alpha) and sometimes may report "false errors" in regular code. Usually, such "errors" "found" only in a truly complex code, and, normally, everything works just fine.
Scala plugin doesn't rely on compiler to analyze code. We're implementing our own model of the language, and sometimes it's challenging, especially when it comes to Scala's type system and type inference (to size up the problem, you may try to formally "infer" a type of "foo".map(_ + 1) expression by hand).

Auto-Completion in Unix VI editor

After using graphical IDE's like Visual Studio, I'm used to pressing CTRL+Space to auto-complete a variable or function name. Now, I know such a thing isn't completely possible in VI, but I heard there was a list of commands that could be mapped that allowed automatic completion of variables and functions in the current file opened. Does anyone know what this sequence is?
Just noticed that you said "vi"; I hope that "vim" is also okay.
It depends on the particular programming language, but in general, the magic word is Omnicomplete.
Put this into .vimrc:
filetype plugin on
set ofu=syntaxcomplete#Complete
Press Ctrl+N or Ctrl+P to trigger the completion. This is insanely customizable; you might like the tips here that make it work more like other IDEs.