Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » JS formatting/colors grief
JS formatting/colors grief [message #754128] Mon, 31 October 2011 23:40 Go to next message
Steve C is currently offline Steve CFriend
Messages: 2
Registered: October 2011
Junior Member
Hi guys,

Just getting into Eclipse (and learning android dev). I've installed and successfully run Eclipse, the Android SDK and Phonegap with a couple of tutorials (on PC), but the editor screens were just white background with black text and no intellisense.

On investigation I found that although Eclipse could interpret, compile and run HTML and Javascript ok, for some reason it needed a plugin to color it (WTP). So I got Eclipse to install it, and then Eclipse wouldn't start. Many trips to stackoverflow proved futile.

I discovered that I'd installed the default version of Eclipse (ie the Java-centric one), and there was a Javascript oriented one. So I uninstalled Eclipse, downloaded the Javascript version, installed it, re-installed the Android SDK, and got a couple of themes from eclipsecolorthemes.org.

Nothing. White page, black text.

I then went into Preferences, had a look at the Javascript settings and lo! There was some beautifully colored sample text in the Preferences dialog. Apparently the settings were already applied, but I applied them again for good measure. Nothing.

More poking around revealed the color settings in the General area of Preferences. I could pick the themes here, but found that no matter what I change it to, my code is still all the one color.

This tells me that eclipse (the editor at least) doesn't know that my code is code, it thinks it's all comments or something (both .html and .js files).

How can I make this thing understand that my html in a .html file is, in fact, html??

I've gone into File Associations and found that it knows .js = javascript and .html=HTML, so why isn't it working?

[Updated on: Mon, 31 October 2011 23:44]

Report message to a moderator

Re: JS formatting/colors grief [message #754130 is a reply to message #754128] Tue, 01 November 2011 00:12 Go to previous messageGo to next message
Steve C is currently offline Steve CFriend
Messages: 2
Registered: October 2011
Junior Member
I've found a cause and a workaround, but not a solution.

If you add a text file to a project, give it an extension and start coding, the formatting part of Eclipse doesn't know what it is (even though the file associations claims it does).

If you go New --> Other --> JavaScript --> JavaScript Source File, it does (apparently adding some metadata somewhere).

That must mean that if you import code from another IDE or code it in notepad, Eclipse can't color it.

Re: JS formatting/colors grief [message #754146 is a reply to message #754130] Tue, 01 November 2011 04:21 Go to previous message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4064
Registered: July 2009
Senior Member

It's more likely you've run into the feature where Eclipse reopens the last editor you used for a particular file by default for that file, meaning if you ever opened this .js file with the plain Text Editor, that's what that file will continue to be opened with unless you tell it otherwise using the "Open With..." context menu. New files use the default for the workspace, which after installing the JavaScript tools, will be the JavaScript editor.

Nitin Dahyabhai
Eclipse Web Tools Platform
Previous Topic:java.library.path work around
Next Topic:Could not open the editor: Null charset name
Goto Forum:
  


Current Time: Sun Jun 20 15:42:44 GMT 2021

Powered by FUDForum. Page generated in 0.03067 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top