javascripteclipseeclipse-pluginmyeclipse

JavaScript file default template not working in Java EE Eclipse


I am trying to create and use the default template for javascript(.js) file in Eclipse. I am using Java EE Eclipse Juno.

I configured in Preferences -> Javascript -> Code Style -> Code Templates -> Code(in right side) -> New javascript Files

I configured like this:

/* *
 * Copyright (c) XXX company. All rights reserved.
 * Use is subject to license terms.
 *
 * Last Modified By   : $$Author$$
 * Modified Time      : $$Date$$
 * File Version       : $$Revision$$
 * File Path          : $$URL$$
 */

I did not change any thing else. And after I tried to create sample.js file in a Grails application, but I am not getting template, just empty sample.js was created.


Solution

  • Put your comments in the Comments/Files template, rather than the Code/New Javascript Files template. The latter doesn't seem to get applied. To have the Comments/File template applied, make sure you tick the "Generate comments" checkbox in the new javascript source file wizard.