Eclipse autocompletion like intellisense - java

MS Visual Studio's autocompletion is called intellisense and the code completion doesn't list the possible functions etc in alphebetical order. It looks at the code around where you are typing and puts the most likely function etc at the top. For instance, if you have called a function named "Draw" multiple times previously, it will move "Draw" up in the list. Eclipse code completion just lists the functions etc in alphebetical order. The attached image shows what I mean. Is there any way of getting the code completion to act like Intellisense?

You can try to install Eclipse Recommenders Plugin. It uses information collected from other developers and tries to provide you most relevant completion.
Code Recommenders automatically analyzes existing code using that API and extracts common usage rules and patterns from it. In the form of recommendation models, this knowledge is then fed back into your IDE. Code Recommenders’ intelligent code completion and extended API documentation then utilizes the power of these models to provide you with the solutions implemented by other developers in the past.

Related

Omni Completion with java

I basically used to write C++ programs and I used OmniCppComplete with vim. It is working fine and I'm happy. Recently I started learning java, so I downloaded javacomplete from here http://www.vim.org/scripts/script.php?script_id=1785. Now the problem is when I use "." to complete any classes or packages its not showing any pop-up. But when I'm using Cx Co, it's working. But OmniCppComplete is working as soon as I press "." on any classes or namespaces. What I'm missing in javacomplete? How will I make it work with "."? please help.
Autocompletion is not a built-in feature. You need a plugin for that. Most autocompletion plugins are more or less language-agnostic while some language-specific plugins like OmniCppComplete give you autocompletion for free.
If you had read OmniCppComplete's doc you woluld know that the autocompletion feature you are used to is reserved to that plugin and you would already be looking (by yourself) for a generic autocompletion plugin because javacomplete doesn't do autocompletion.
Say... on vim.org.
Completion plugins provide you sources (often classes, methods, and variable names from the current file). They still have to be triggered. Since most plugins use the omni completion extension point of Vim, that trigger is <C-x><C-o> in insert mode.
The OmniCppComplete plugin seems to add a custom completion trigger on the . (because that makes a lot of sense for C++). The Java pendant doesn't. If you would like to have a consistent behavior, either:
add the . completion trigger for the Java completion yourself (taking implementation hints from the other plugin)
submit an enhancement request to the plugin's authro
switch to a generic completion plugin that handles multiple languages consistently

JavaScript on Netbeans Scarce Code Support Features

I have difficulties coding in JavaScript with Netbeans. I can't see beforehand:
my mistypes,
relations between classes, functions and variables (dependency, parents-children etc.),
javadocs references (both original and imported for libraries).
THE PROBLEM is in:
heavy debugging because of primitive mistype and the use of irrelative substances;
time consuming browsing to find help for the context.
I TRIED:
Netbeans 7.4 (some basic Ctrl+Space lookup is supported, but very limited and usually useless);
Eclipse 3.8 (no context support);
These IDEs provide adjustable autoformatting and text mark-up (braces, clever tabs, text colors etc.) This is all very helpful, but insufficient. After having to migrate from Java to JavaScript for job routines, I now understand how much work had I automized and saved coding Java. I just feel I'm missing Ctrl+Space after a dot for Javadoc and Ctrl+LeftClick to navigate to declaration. It results in more time creating similar things in code.
THE QUESTION IS:
How to get JavaScript language docs for Netbeans?
How to make Netbeans show relations between classes, variables and functions so that I don't see what can't be done from this context? For JavaScipt like it does for Java?
Here are Netbeans JavaScript snapshots with everything that's needed. Where is that all? I don't see it in my IDE:
I can't add comments because i haven't reputation enough...
I am a Java developer since Java version 1.1, and Netbeans's truly fan since version 5.5 (Eclipse? What's that thing?).
I am currently developing Javascript code in Netbeans 7.4. It offers code completion exactly as it does with Java (plus javadoc-style documentation popup, Ctrl-Space behavior, colouring code...), almost the same pros and cons as developing java, php or another language...
And yes, it saves a lot of time of searching for object's methods and properties, misspelling...
---- Text added since your last editing some minutes ago....
OK, i know i'm not impartial, forgive me... Take a look to this, it may be helpful:
Netbeans 7 HTML5 webapp javascript debugging
Maybe I don't know really what are you looking for, but in my opinion it is a good stuff. If you can debug an HTML5 webapp to such deep level...enough for me.
About the inline documentation in a javadoc-style, my NB shows a pretty nice one (bundled, i didn't plugged anything...). Of course, it could be more complete or functional... Take a look to this image:
Next I'll try webstorm... Good luck!
---- More Text added .... jQuery documented API integration...
Ok, let's see how NB manages itself to show you a wonderful javadoc-style documentation popup of jQuery API...
It looks so good to me... I love it :)
I only added the developer version of jQuery (the one commented and uncompressed) to the src folder of my opened Java project... nothing more... I think this is some kind of magic... Maybe you can add your own commented .js libraries in the same way. Just explore the jQuery .js to learn how to comment your code.
Just one more resource for you:
Adding jQuery to your NB project
I think, that you cannot expect the same level of tool support for Java (strongly typed, object oriented) and JavaScript (weakly typed, functional).
Compiler for strongly typed languages knows, what is allowed in given context, but in JavaScript is the situation drastically different. Everything is dynamic and you cannot tell what is mistype.
Anyway I think, that latest NetBeans 7.4 has really great support for JavaScript including code completion.
You can see here for such IDE. Also you can take PhpStorm, Idea, WebStorm.
I think the best IDE for JavaScript would be the JetBrains WebStorm.
The company has also made IntelliJ Idea IDE for Java, which is in my humble opinion the best one available.
You can download free version here: http://www.jetbrains.com/webstorm/
I'm using it a lot myself and I can really recommend it.
Steps below helped me to partly resolve the problem:
Changed project type from HTML5 to PHP to exclude libraries folders from code analysis as described here;
Configured at Tools - Options - Editor - Hints - Javascript to "Suggest for current line" instead of "Warning".
tune up and use correct tags for javadocs as described here;
Resolved proxy connection problems to make IDE see the Internet: Tools - Options - General;
updated Netbeans to 7.4 from 7.4RC1;
Now you have:
- fast code completion popup window load,
- docs texts, including pop-up code completion docs for your own comments,
- can navigate to declarations from other files Ctrl+LeftClick,
- have suggestions on errors,
- type recognition failing if you mistype function or variable name to smth impossible.

Java source code editor as an Eclipse view

I have defined an EMF metamodel in which some elements have a String field which will contain some Java code.
I am trying to create/reuse a (Java) source code editor as part of the tabbed properties view to be able to edit that field with some IDE-like functionality. It would be great to adapt the JDT editor to use it here, but for I have read, it is not feasible. Extending org.eclipse.swt.widgets.Text to provide all that functionality seems to be too much of an overkill for this simple project.
Therefore, the question would be, which approach would you recommend as the best functionality/effort ratio to achieve this?, do you now of any source code editor which may be reusable as/within a view?
Buddy...
This is really going to be a hard task.
Re-Using EditorParts in SWT widgets/ViewParts is not easy. The only thing that I got to manage was to reuse the EPF RichText-Widget which was designed for use as an EditorPart.
In that case it was easy, because it only needed an IEditorSite as a constructor parameter. I then extended it and adapted the IViewSite to an IEditorSite.
But concerning JDT: There is so much funcionality which is directly related to the Base-Text-Editor functionality from eclipses IEditorParts... I think it won't be worth the effort.
Could't you find a Java-IDE for Java-Code? Isn't there anything working with Swing/AWT?
You could then possibly include a Source-Code-Editor-Swing-Frame using a SWT_AWT-Brigde-Widget. This way I successfully integrated an Swing-PDF-Viewer into an eclipse ViewPart.
Take a look at the eclipse API desciption.
And as a first rough try for the Java IDE:
drJava
I have done a lot of work with modeling and code generation and this problem has never really been solved satisfactorily. There are many in the Model-to-Text community that argue that code should not be in the model for this and other reasons.
My approach in the past has instead been to generate my code from the model leaving comment-bracketed regions for the developer to enter their business logic and other code snippets directly into the generated code using their favorite editor. If the model changes and the code is regenerated, the developer-supplied code is retained. This also has the benefit of supporting any language (Java, C, Objective-C, JSP/HTML, etc.) and for defaulting to an appropriate default stub of generated code.
Look at the <c:userRegion> tag in Eclipse M2T-JET as an example. I believe the other Eclipse Model-to-Text technologies have similar functions.

How to implement a java IDE with Java

I would know how to implement a Java IDE using Java language.
My IDE should :
compile, run and debug a source code.
import or export file from a directory.
allow generating code from class diagram.
allow modifying Java text editor.
allow generate Swing source code from, I mean it will offer a ability of drag and drop, then it generates source code.
it gives possibility to save, delete, undo and redo.
it support JUnit, maven and Ant.
So, I ask about technologies that will help me to realize this Java IDE. How to implement this IDE?
Except for the "drug" part which I am not sure of, I can tell it is not a trivial amount of work and of course I'd use the Java's GUI API
http://en.wikipedia.org/wiki/Swing_%28Java%29
Will not be sarcastic like others around here so I will try to give a short answer.
Despite there are some very very mature Java IDE's (Eclipse,NetBeans,INtelliJ ,JCreator,Codeguide etc) around it is your right to do another (who know someday maybe better then existing ones).
This being said you can do it
Swing (here you have to start from
zero)
use RCP Eclipse
Netbeans platform
QT it might be a solution
etc.
All of this support drag and drop and have support for creting class diagrams...
I warn you it is not easy....not easy at all.
Eclipse was audited recently and it has apx. 46 millions line of code
Good luck !
I'd safe yourself loads of time and just use Netbeans out of the box. Does everything you've listed and more. It's also free and has a module architecture to allow new functionality to be added fairly easily.

Trying to remember name of a code visualization tool

I recall a while back seeing an experimental code visualization tool, with the intention being to enable a user to manually track interconnectivity between different parts of their code for the purposes of implementing specific features. In particular, a user could pull out a window into their code and associate it with a completely different part of their code, seeing lots of independently controllable code snippets (and any relevant notes) linked together. The purpose of this tool was to enable someone working on a chunk of code that crossed multiple functions (or separate modules) to be able to more cleanly figure out what was going on and to see more of the relevant code at once. This is kind of similar to just opening boatloads of small windows at once, drawing lines between them, and having each window be a view of a file (some windows could be looking at different parts of the same file, some windows might just be notes).
I think the experimenters made an Eclipse plugin for the concept using Java.
Anyone have any idea what I'm talking about?
Maybe CodeBubble?
The essential goal of this project is to make it easier for developers to see many fragments of code (or other information) at once without having to navigate back and forth.
Each of these fragments is shown in a bubble.
(although Mylyn is kind of similar in its approach, but with less diagrams ;) )

Categories

Resources