Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 311674

Summary: No color coding for files that don't have htm/html extension
Product: [WebTools] WTP Source Editing Reporter: Marc <m.schipperheyn>
Component: wst.htmlAssignee: wst.html <wst.html-inbox>
Status: RESOLVED INVALID QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 CC: nsand.dev
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
content type preferences none

Description Marc CLA 2010-05-05 04:56:46 EDT
Build Identifier: Eclipse: 20100218-1602, Eclipse webdeveloper 3.1.1

Many files that contain html content don't necessarily end with html or htm. In my case Freemarker (.ftl). There is a standard editor for it, but it's crap and so you revert to the default html editor. Unfortunately, the files are not being color coded when opened with the HTML editor which kinda sucks.

I would expect an HTML editor (or any editor for that matter) to color code files openend in it according to its internal color coding rules. Surprised it doesn't and can't seem to be forced to either.

Reproducible: Always

Steps to Reproduce:
1. Just open any file with HTML content that doesn't end with htm/html
2.
3.
Comment 1 Nick Sandonato CLA 2010-05-05 10:18:37 EDT
Hi Marc,

The HTML (along with other Structured Text Editors) require the file to be associated with a content type by their nature.

If you go to Window > Preferneces then General > Content Types, expand the Text node in the Content Types tree and find HTML. Under the File Associations, add the extensions you're working with (*.ftl for example) and click Ok. Now .ftl should be associated with the HTML editor by default.

Hope this helps.
Comment 2 Marc CLA 2010-05-05 12:55:20 EDT
Hi and thanks for your reply. I should have mentioned in the bug report that I had already taken this step. The file association for *.ftl is set to HTML Editor and that has no effect.

When I go to the file extension for *.htm I see HTML editor (locked by 'HTML' content type). Not sure if that has anything to do with it.
Comment 3 Marc CLA 2010-05-05 12:55:40 EDT
Reopened
Comment 4 Nick Sandonato CLA 2010-05-05 13:16:14 EDT
Hey Marc,

Some of the terminologies do overlap between the two preference pages. It sounds like you are setting the "File association" through Editor > File Associations. My instructions were for setting the content type of *.ftl to be of the HTML content type. Once you associate the correct content type to *.ftl, you shouldn't have a problem.

Once your file extension is associated with the HTML content type, you no longer will need the entry for *.ftl in the Editors > File Associations preferences. This is because the HTML editor is associated with the HTML content type.

I hope this makes sense.
Comment 5 Marc CLA 2010-05-10 12:29:03 EDT
Hi, didn't seem to work for me. Went into registry editor to add HTML mime to ftl files (isn't there an easier way on xp?). Nothing changed.
Comment 6 Nick Sandonato CLA 2010-05-10 13:10:37 EDT
Created attachment 167760 [details]
content type preferences

(In reply to comment #5)
> Hi, didn't seem to work for me. Went into registry editor to add HTML mime to
> ftl files (isn't there an easier way on xp?). Nothing changed.

Hi,

You shouldn't need to edit the registry or anything like that.

The preference I'm talking about is in the Eclipse preferences accessed by Window > Preferences. Expand General > Content Types. From the Content types tree, expand Text and select HTML. In the File Associations add *.ftl.

Please see the attached screenshot for a reference.
Comment 7 Marc CLA 2010-05-10 13:46:50 EDT
Ah, finnally got it. The Windows Preferences threw me off. Feel like a real newbie here suddenly. :-) Thanks for your patience.
Comment 8 Nick Sandonato CLA 2010-05-10 13:53:11 EDT
(In reply to comment #7)
> Ah, finnally got it. The Windows Preferences threw me off. Feel like a real
> newbie here suddenly. :-) Thanks for your patience.

No problem, I'm glad it's working out. As they say, a picture's worth a 1000 words.