IntelliJ Code Completion - visual-studio

I really like the Code Completion in Visual Studio: I have a Variable called myrandomvariableand when I type myrandfollowed by a dot or a space, VS automatically inserts myrandomvariablefor me. I am so used to this, that in any other IDE I always expect the same behaviour and do not press ctrl+dot, enter or whatevers key combination. As I am using Android Studio I want to know if there exists a way to use the Visual Studio Style Code Completion in a IntelliJ IDE.
Thanks

You can easily enable this feature in IntelliJ.
Go to Settings/Editor/Autocompletion and check insert selected variant by typing dot, space, etc.
Btw: settings section was restructured a bit so this setting might be in a different location in IntelliJ 14 (I currently have 13 installed). But you should be able to find it easily using search dialog in case this is no longer the correct location for IntelliJ 14.

Related

Is there a code snippet editor for Intellij Idea 13?

Visual Studio has Snippet Designer extension available for creating and managing custom code snippets. Is there something like this extension for Intellij Idea 13, or a way to simply add custom code snippets?
There's no extension that I'm aware of (and I'm not familiar with Snippet Designer), but that functionality exists in IntelliJ Idea.
Hit Preferences and start typing to find "Live Templates". Expand one of the existing ones to see some of the available functionality. You can set tab stops, cursor position, references to local variables. It's very handy.

Can I save multiple command arguments for VS2012 debugging

Summary: Is there an easy way to save alternate command arguments used by the Visual Studio debugger?
Details:
Visual Studio has an option to set Command Argument that are used by the debugger. For example in the screenshot shown here I've set them to FOO BAR. Sometimes when debugging a project I want to switch the arguments to test different input sets. And often the arguments are much longer than just FOO BAR. It would be nice if there was a way to save the arguments that I've typed and switch between them quickly. Ideally it would also be possible to change the working directory at the same time. But I haven't found a way to do this yet so that's why I'm asking here. I'm using Visual Studio Professional 2012.
You can just create new configuration(s) for this project. I see that your current active configuration is Debug (top left corner of project settings dialog). You can create new configuration(s), which will be based on this one, and name them like Debug-Test1, Debug-Test2, etc. After you will do this you will have a choice to switch between this configurations in VS Debug Toolbar.

Type ahead autocompletion in Eclipse

Do Eclipse have a plugin for type ahead autocompletion like Visual Studio, so I don't have to destroy my spacebar by pressing Ctrl+Space all the time? (If you don't know how it works in Visual Studio, please don't bother answering.)
And also, can I limit the autocomplete to imported packages, rather than every single Java class on earth? It's fustrating seeing suggestions from awt and swing etc., when I'm working with GWT. And I don't want to add every single Java class to the filter, that's just stupid. (Again, like how it's done in Visual Studio!)
Regarding your second part, yes you can
Open Eclipse
Select Window/Preferences from the menu
Expand Java/Appearance/Type Filters from the menu on the left
Click the "Add package" button, enter "java.awt" (without the quotes) and click OK
OK your way out
This will make Eclipse remove any matching classes from the java.awt package from your type ahead list. Very nice...
So "type-ahead" exists in Eclipse (mentioned in this status report in June 2006), but is synonym of auto-completion, most often triggered by CTRL+ Space... (which is not exactly what you are looking for)
To be more specific, the kind of automatic auto-completion (completion while you are typing, with a "Common" or "All" list of possible completions) you have in Visual Studio is not there in Eclipse (actually read below):
Original answer January 2010:
At least, not without a dedicating plugin.
And even with that plugin, it would have to follow a TemplateCompletionProcessor, meaning it would need a list of characters triggering said completion (again, not what you are looking for), by redefining method getCompletionProposalAutoActivationCharacters().
Update November 2011:
Cristi mentions in his answer (upvoted) a great workaround, which consists adding all the letters as Auto activation triggers for java.
See also "Automatically opening completion window in Eclipse".
From the thread "Eclipse auto-completion ":
Windows -> Preferences -> Java -> Editor -> Content Assist
Set delay to: 0 (actually >0 is better: 50, it avoids CPU picks because of constant listening)
Set triggers to:
.(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV WXYZ#
My answer may come too late, but maybe will help others searching this feature in eclipse.
This workaround works for me (eclipse helios):
Go to Windows -> Preferences -> Java -> Editor -> Content Assist.
Here, enable Auto activation and set Auto activation delay to a low value, let's say 50 ms.
Then comes the workaround: In Auto activation triggers for java, simply put all the characters: abcdefghijklmnopqrstuvwxyz.
And there you go, just type something.
Completion is triggered when pressing ".", if that is what you are referring to as "type-ahead autocompletion". This is what Visual Studio also does, unless you are referring to another Visual Studio feature I'm unaware of.
Limiting completion to only imported packages I think is a somewhat unorthodox thing to do; you are forced to rely on wildcard imports to define the set of types to complete on. I think most users would consider that less than useful. You're welcome to elaborate on your use case for this, though. For example, why would you want to exclude all Java classes from completion?
BTW, using "type filters" (as VonC suggests) doesn't require you to add every single class. I typically (globally) exclude java.awt.*, sun.com.*, org.omd.*, and a few others. Eclipse also sorts completion according to a (type-sensitive) heuristic which usually results in the most relevant types being displayed at the top. For example, auto-completion inside a method call will put the variables which matches the method type signature at the top.
I know that Claus spoke of Java in the second part of his question, but the general question is about any language in Eclipse (no Java tag here), so the following might be of use to python eclipse coders:
Go to Windows -> Preferences -> PyDev -> Editor -> Code Completion. Here, check the box next to "Request completion on all letter chars and '_'?".
(Purposefully similar to Cristi's answer.)

AutoClose parens, braces, etc in Eclipse and in Visual Studio

I want to know the name of the specific editing mode in which the editor automatically closes the paren after you write (, and then you can jump right after the ) when you press a tab. It does the same thing with ". How can one get this thing working in VisualStudio and in Eclipse?
Thanks.
upd: clarification of the title. The name of the feature is AutoClose
upd2: Visual Studio doesn't support this natively --> source
upd3: A similar question. Turns out ReSharper can do this for C# and VB, but still nothing for native C++.
I am going for the eclipse IDE (cause is the one that i know, but there are lots of VisualStudio gurus over here that probably will come with the other half).
In eclipse you are talking about the "Formatter" feature, that is located under the menu Window / Preferences, and then select in the right tab (Java / Code Style / Formatter ) and then you can edit the active profile (there is a section called "braces" that defines the behaviour that you are talking about).
To assign that behavior to another file type, you can choose open that file with the Java Editor, or assign that editor (Java Editor) by default to another extension (Under General / Editors / File Associations, also in the preferences dialog).
Hope this makes sense for you.
Intellisense? If I understand you correctly

Plugin for Visual Studio to Mimic Eclipse's "Open Type" or "Open Resource" Keyboard Access

If you've ever used Eclipse, you've probably noticed the great keyboard shortcuts that let you hit a shortcut key combination, then just type the first few characters of a function, class, filename, etc. It's even smart enough to put open files first in the list.
I'm looking for a similar functionality for Visual Studio 2008. I know there's a findfiles plugin on codeproject, but that one is buggy and a little weird, and doesn't give me access to functions or classes.
Vs11 (maybe 2010 had it too) has the Navigate To... functionality which (on my machine) has the Ctrl+, shortcut.
By the way it understands capitals as camelcase-shortucts (eclipse does so too). For instance type HH to get HtmlHelper.
This isn't exactly the same as Eclipse from your description, but Visual Studio has some similar features out of the box (I've never used Visual Assist X, but it does sound interesting).
The Find ComboBox in the toolbar ends up being a sort of "Visual Studio command line". You can press Ctrl+/ (by default) to set focus there, and Visual Studio will insert an ">" at the beginning of the text (indicating that you want to enter a command instead of search). It even auto-completes as you type, helping you to find commands.
Anyway, to open a file from there, type "open <filename>". It will display any matching files in the drop down as you type (it pulls the list of files from the currently open solution).
To quickly navigate to a function, in the code editor press Ctrl+I to start an incremental search. Then just start typing until you find what you are looking for. Press Escape to cancel the search, or F3 to search again using the same query. As you are typing in the search query, the status bar in the lower left corner will contain what Visual Studio is searching for. Granted, this won't search across multiple files (I've never used Eclipse much, but that sounds like what it does from your description), but hopefully it will help you at least a little bit.
If anyone stumbles upon this thread:
There's a free plugin (created by me) for Visual Studio 2008 that mimics the Eclipse Ctrl+Shift+R Open Resource dialog (note, not the Open Type dialog). It works with any language and/or project type.
You can find it at Visual Studio Gallery.
Some of the neat features are available in Visual Assist X, though not all of them. I've asked on their forums, but they haven't appeared as yet. VAX gets updated regularly on a rough 4 week period for bug fixes and a new feature every couple of months.
If you are looking for an add-in like this to quickly navigate to source files in your project:
try the Visual Studio 2005/2008 add-in SonicFileFinder.
Resharper does this with the Ctrl-N keyword. Unfortunately it doesn't come for free.
Visual Studio doesn't have anything like this feature beyond Find.
Found this thread while searching for Eclipse's Ctrl+Shift+R, and after seeing the Visual Studio Gallery, found the DPack Tools (they are free, and no, I'm not endorsed in any way by them).
But it's exactly what I was searching:
- Alt+U -> File Browser (a la Eclipse Ctrl+Shift+R)
- Alt+M -> Code Browser (Method list in the actual class)
It has more features, but I'm happy with these ones.
I have been using biterScripting along with Visual Studio to do more flexible searching and manipulation.
It can search the entire workspace.
It can search within any project - EVEN IF THAT PROJECT IS NOT LOADED OR EVEN PART OF A WORKSPACE.
It can find things using regular expressions.
AND, ABOVE ALL, it can make bulk changes. For example, want to change the name of a class from CCustomer to CUser, I can do it in just a few command lines - Actually, I have written scripts for things like this I do often. I DON'T HAVE TO CLICK ON EACH INSTANCE AND MANUALLY DO THE CHANGE.
And, it is inexpensive ($0). I downloaded it from http://www.biterscripting.com .
I'm also comming from the Java Development side and was looking for the CTRL+T feature in the Visual Studio. The other answers refer to open file, but since in C# the class name and file name can be different this is not what i was looking for.
With the Class View or the Object Browser you can search for Objects and Classes
[View]->[Class View] or [View]->[Object]

Resources