Simple Eclipse Code Templates - Issue - eclipse

Hi I have Code Templates enabled in Eclipse.
I just installed Eclipse for Java and Enabled Code Templates (From Code Assist Settings). I typed "sysout" Ctrl+Space, but I do not System.out.println.
Also, what exactly does Automatically Insert mean in the Code Completion options?
Thanks.

Content assist can insert 'single' proposals automatically (you have to enable the corresponding preference for this on Java > Editor > Content Assist page).
P.S. "sysout" works for me.

Related

Stop Eclipse from autocompleting variable names on declaration

Edit: I am a dumbass who repeatedly went into CA for JavaScript instead of Java. This is what happens when you blindly use the search box, folks.
I know this question has been asked and answered here before, but there's a problem. The solution just isn't there anymore.
I have the exact same problem as this good fella. I saw the answers, they say it's been patched in the 2018-12 release, which I assume is about 18 months old (I've only recently started using eclipse). I'm on the 2020-03 release and, as I said, the Disable insertion triggers except 'Enter' just isn't there anymore. See below:
Eclipse Preferences->Editor->Content Assist Window in 2020-03 release:
I tried looking for it elsewhere in Preferences but I can't find it. When I try to google it all that comes is this same solution, and nothing useful comes up if I filter the searches for time. Does someone know where this option went or if there is another way I can fix this? It's driving me nuts.
Your screenshot shows the JavaScript, not the Java content assist preference page where this setting has never existed:
Window (macOS: Eclipse) > Prefences: JavaScript > Editor > Content Assist
The Java content assist setting described in the mentioned answer can still be found at the same place:
Window (macOS: Eclipse) > Prefences: Java > Editor > Content Assist

Red code errors not showing up?

I am having trouble trying to activate(?) red error codes in MyEclipse Pro 2014 (I have the same problem in Eclipse Luna). I just downloaded it today and whenever I make an error, even on purpose like a misspelled keyword, MyEclipse won't show red marks on the side like how IDEs usually do. Is there any way I can fix this? Also, content assist doesn't work for me neither. Any help would be greatly appreciated!
Check that you have the Java editor configured in preferences, file associations, as the default editor for Java files. If you're using the text editor, then content assist won't be available although errors should show up after saving the file. However, if you have disabled or removed the Java builder (in the project's properties Builders page), then no marks will show up. Try a new project in a new workspace to check if the problem persists.

Eclipse for Android, lost code completion feature

I wanted to transfer my Syntax coloring settings from my Eclipse EE to my Eclipse for Android, so I did what is told in this question. The problem is that, even if my syntax coloring did apply correctly, I lost all my code completion and proposals (and, conveniently enough, I didn't make a backup)! If I press ctrl + space, I get a No default proposals message. Always.
I wouldn't like to have to install the whole IDE again, so if someone could provide a solution to this it would be much appreciated.
Preferences > Java > Editor > Content Assist > Advanced lists the default content assist proposals. Check that some proposals are actually enabled.

How can do code alignment in Eclipse base Force.com IDE

How can do code alignment with Eclipse base Force.com IDE.
Alignment shortcut key 'CTRL+SHIFT+F' is not working for Apex code.
None of the suggestions so far work for me. Note that the Force IDE opens the Apex class in an Apex Editor. This editor does not appear in the list of contexts that you can associate with a key event. For example, this list contains such contexts as "editing in structured text", "editing in Java Source", etc.
The Apex Editor does not contribute a "Source" menu option to the right click menu. So there is no way to get to the formatting features.
I tried to open the apex class in the Java. Now the "Source" menu option appears the format option doesn't do anything. (Hence no key event will be able to do anything.)
The only thing I can get to work is this ...
Select file.... Open With... Other ... locate Java Editor.
Once file is open ... select all text .. right click and select Source ... Correct Indentation .
This does not reformat but it does fix the indentation problem.
Someday I hope SFDC will make the code for the Force IDE open source. Then we, as a community, could build more developer-friendly tools.
Apex classes and triggers use a different editor than Java. The auto formatter (or code alignment) does not work with Apex Code (or the Apex Code Editor). I couldn't get CTRL-SHIFT+F to work in the most recent version of Eclipse with the Force.com IDE, either. I believe this is because the auto formatter is designed to work with Java only.
However, if you switch to the Java perspective and open your Apex class with the Java Editor, CTRL+I does correct indentation properly.
Go to Preferences -> General -> Keys and type "format" into the search box, you will see what keys (if any) are bound to the format commands. Then you can bind what you like or use what's available.

Eclipse Code Formatter Plugin

Can some one suggest me a plugin to format HTML and JAVA code with proper indents etc ? Is there any built in option there in Eclipse ?
Use Source -> Format or CTRL+SHIFT+F
Eclipse does have built in Java formatting:
Preferences > Java > Code Style > Formatter
For HTML, you might try something like HTML Tidy. The Web Tools Platform project also includes formatting.
It's a combination of all the answers above, which suits me-
Go to Preferences > Java > Code Style > Formatter and set all the options you want by creating your own profile or using a default one. Personally I find the line-wrap limited to 80 a little too low. I set it to 200.
Save the 'custom' preferences by giving it a new profile name (export it for future restoration)
Select the code in your editor - then hit CTRL+SHIFT+F. That should format your code.
Worked wonders for me everytime.
Java code formatting is built in. Go to Window->Preferences->Java->Code Style->Formatter. There's a built in profile set up and you can make your own.
http://sourceforge.net/projects/jalopy/
Note that Jalopy has its settings under Window> Jalopy Preferences.
(This menu option appears only when all editor tabs are closed)
Eclipse doesn't have proper built-in code formatting. You might want to open your project in Idea IntelliJ or Netbeans and use their formatting to do a thorough job on it.