Highlight .tpl syntax in Eclipse - eclipse

I've been googling and can't find a solution for this. I'm trying to setup .tpl files to use either HTML syntax highlighting or PHP syntax highlighting. Has anyone does this, or do you know how?
Thanks

Go to Window -> Preferences-
Then General -> Editors -> File Associations-
Add the PHP Editor to the *.tpl file type. You may have to create the *.tpl type if it doesn't already exist.
You may also have to set the content type for your tpl files in Content Types also under the General settings. Scroll down to PHP Source File and make sure *.tpl exists there as well.
Then you need to restart eclipse to make it work.

Go to Window -> Preferences -> General -> Content Types
Select Text -> CSS, click Add, write *.tpl and save.
Do the step two for Text -> HTML, Javascript and PHP.

I took that from this link. You can get that form there or I give their content below if the anyhow that link doesn't work. It works for me nicely.
steps how to install SmartyPDT 0.9.1
Be sure that the .TPL files are not associated with any content type (file type). In Eclipse,
Be sure that the .TPL files are not associated with any content type (file type). In Eclipse,
Go to Help-> Install New Software
At the Work With section click on the Add... button. Give the new "Site" a name and set the location with http://smartypdt.googlecode.com/svn/trunk/org.eclipse.php.smarty.updatesite/ , then click OK. Go back to the Install New Software window and select the newly added "site". If the "Group items by category" check-box is checked, uncheck it. Now you should be able to see 1 item in the software list named "Smarty Feature"
Select the Smarty Feature, click Next> and from here afterwards it shouldn't be a problem.
If you are prompted that this is an unsigned package, just ignore the warning and install it anyway.
After the installation completes, restart Eclipse and it should be working.
Define a default PHP executable of type 'Zend Debugger' (only if you install vanilla Eclipse PDT):
In Eclipse go to Window->Preferences->PHP->PHP Executables Click on the Add button. Enter a name for that executable definition, for example "PHP localhost", complete the 2 fields which ask you for the PHP executable path (the PHP binary CLI executable) and php.ini path. Be sure that the PHP debugger is the Zend Debugger.

Installing smarty on eclipse kepler fails
(see Install SmartyPDT 0.0.9.1 in Eclipse Kepler).
The recommendation there is to use the PHP Development Tools (PDT) from former eclipse juno version. But in contrary to the recommendation I did not DELETE the mentioned features folder but I just uninstalled the plugins from eclipse itself (Help/About/InstallationDetails):
Uninstall all PDT packages
Restart eclipse
Then follow the instructions in above answer to install the PDT packages from Juno version and then the smarty package.
All these Installations worked without error.
But unfortunatly the *.tpl files are still not syntax highlighted. What to do more?

Our *.tpl file extension is not associated with the HTML editor in Eclipse by default.
Open Eclipse’s preferences.
Expand General from the tree on the left and select Content Types.
Expand Text on the right and select HTML. Click the Add... button below, enter *.tpl and click the OK button.
General -> Editors -> File Associations
Click Add..., enter *.tpl, and click OK.
Select HTML Editor from the Associated editors: section below and click the Default button to the right.

Related

No JavaScript syntax highlighting in Eclipse 2020-09

I just upgraded to Eclipse 2020-09 (4.17.0) from Eclipse Luna. After installing, I installed Eclipse Web Developer Tools 3.19 from the Marketplace, then restarted Eclipse. When I open a .js file, there is no syntax highlighting. It was fine out of the box with Luna, so is there anything extra that I need to configure in 2020-09? File associations for *.js shows this:
It seems JavaScript files (*.js) have been associated with the plain text editor instead of the Generic Text Editor by mistake (please make sure it has been reported to Eclipse).
Right-click the file and choose Open With > Generic Text Editor.
Or better, associate all *.js files with the Generic Text Editor by right-click a *.js file, choose Open With > Other..., select the Generic Text Editor in the list and tick the Use it for all '.js' files* checkbox at the bottom (as shown in my video here).
Yes, you need to install the Wild Web Developer feature so that it provides that functionality through the Generic Text Editor.

How to enable syntax highlighting for *.handlebars files within Netbeans 8

Perhaps this question might be silly, but I need some help. I did the upgrade from Netbeans 7.1 to Netbeans 8, in order to get more functionality and I'm involved in a project that uses handlebars. The problem is I can not find a way to highlight this file. I've tried to go to tools-> options-> Miscellaneous->file and change the file extension and file type associated with no results.
Can you help me with this issue or give me other alternatives that support web editor handlebars?
thank you
I followed this link and applied the HTML mime type and worked fine.
This are the instructions from the webpage:
Go to Netbeans -> Preferences -> Miscellaneous -> Files on a Mac
or Tools -> Options -> Miscellaneous -> Files on Windows
Leave "File Extensions" as "< Choose the extension >" and click the "New" button.
Type in the extension without the dot.
Select the appropriate file type from the "Associated file type (MIME)" drop down box.
http://www.electrictoolbox.com/netbeans-syntax-highlighting-file-extensions/

Open directory containing a source file via Eclipse

In Visual Studio, or MyEclipse, you have a button which is able to locate a source file on disk, and open the containing directory in Windows explorer.
This is useful, for example, to browse images, or to use an other tool when a conflict occurs in CVS or SVN.
What would be the way to do it in Eclipse with a free plugin, or without any plugin ?
I found it :
"In eclipse, it is common requirement to open the folder containing source file but there is no direct method to do that like in Visual studio of Microsoft."
http://shivasoft.in/blog/others/tips/locate-source-file-on-local-disc-in-eclipse-external-tool/
An actual plugin can be found at http://blog.samsonis.me/2009/02/open-explorer-plugin-for-eclipse/
And version 1.5 can be found here http://blog.samsonis.me/2011/08/openexplorer-eclipse-plugin-1-5-0/
One that I've since upgraded to & find more useful
http://basti1302.github.io/startexplorer/
I always do this:
right click on file/folder, show in..., system explorer. Done.
I guess we don't need a plugin to do that, or I am misunderstanding the question?? I am using Luna 4.4.2 on Windows 7.
On Mac you can follow this steps to add it without a plug-in:
Click the disclosure icon to the right of the External Tools icon:
Select External Tools Configuration:
The External Tools Configuration window will appear. Select Programs and then click New Launch Configuration:
This will create a new launch configuration. Enter a name of the configuration in the name field:
In the Location field enter the path to the Open Finder, "/usr/bin/open" without quotes:
In the Arguments field enter the following argument, "${container_loc}" with quotes:
Click Apply. It should look like the following:
Switch to the build tab and deselect Build before launch:
Switch to the Common tab and select the External Tools checkbox in Favorites. Click Apply again and close out of the window.
You are done. Now to use:
Select a file or folder in Eclipse Package Explorer.
Click the disclosure icon to the right of the External Tools icon:
Select the Open Containing Folder from the drop down menu:
You're file or folder should open in Finder.
PRO TIP: After you use the external tool once you can click the External Tools icon again and it will run the last used external tool. In other words, you won't need to select it from the pop up menu each time.
You can also look up the source directory by right clicking on the project, going to properties, and looking at "Location: ... "

Eclipse Indigo "Save Actions" are not being applied

I'm new to Eclipse and downloaded the following version:
Eclipse Java EE IDE for Web Developers.
Version: Indigo Release
Build id: 20110615-0604
[edit] Eclipse Platform Version 3.7
I have edited Java > Editor > Save Actions to do the following: Remove trailing white spaces on all lines, Correct indentation
When I save the .java file, those actions are not applied... is this a bug?
Found this that might be related: https://bugs.eclipse.org/bugs/show_bug.cgi?id=350475
Assuming that this relates to JavaScript files, then the related Eclipse bug could be helpful.
The problem (as I've just experienced) is that you can edit the JavaScript -> Save Actions preferences via the context menu when editing a JavaScript file, but the actions will not be run.
The solution is to right click on the project containing the .js file, and select Configure -> Convert to JavaScript project.
The bad news is that this will then will also enable Eclipse's not-so-great JavaScript validation, therefore telling you that libraries such as moment.min.js are broken.
Well for those of you who have found this topic... I did find 2 solutions, no thanks to Eclipse, other than the fact that it is open source and people can write plugins.
Eclipse Platform Version 3.7
AnyEdit - plugin that does it for you when you Save file (I believe this is what eclipse SHOULD be doing)
Go to: Window > Preferences. Then under General > Keys. Make sure drop down for Scheme: is Default and enter 'remove trailing' in the filter. You should then see "Remove Trailing Whitespace" under the command column. Bind it to your own key command.
The only drawback to #2 is that you have to actually press the key binding while editing the file, kindof like a cleanup action.
Too bad Eclipse hasn't taken the approach that ALL file types should be configurable in this way... sometimes I miss TextPad.
Old question, but at least for newer Eclipse versions there's a better solution: Go to the project properties, then to Project Facets. If it tells you that your project isn't in faceted form yet, then convert it. Afterwards (or if it already was faceted), just enable the JavaScript checkbox.
I had the same issue with Eclipse 4.4 (Luna) and this fixed it for me, the save actions are now executed on save.
Adding to jlh's answer, I also had to configure the JavaScript include path of the project to enable save actions. Before that even a manual "Clean Up ..." from the source menu wouldn't work.

How to use eclox, the doxygen plugin for Eclipse

How do I get eclox working in Eclipse 3.5?
I'm using Ubuntu 9.04. I installed Doxygen from ubuntu repositories(version 1.5.8). Then I installed eclox on eclipse through the update site.
Despite this, I don't get any option to in any menu to initiate it.
Also the eclox site doesn't seem to have any "getting started" guide.
Please help.
BTW there is a manual inside org.gna.eclox_0.8.0.jar, wierd they did not post this on the project site!!!
Here is the content
Eclox, a Doxygen frontend plugin for Eclipse.
<http://gna.org/projects/eclox>
INSTALLATION
There are two options to install the plugin: using the update site or
using the packaged feature.
The update site is the more convenient way to install eclox. It is
located at https://anb0s.github.io/eclox. See eclipse's user
guilde for additionnal details.
When using the packaged feature, you must extract the archive content into
your eclipse's root location. For additionnal details, please refer to
eclipse's user guide.
CONFIGURATION
Once the plugin installed, you must ensure that the default PATH environment
variable makes the doxygen binary reachable for the plugin. If not, you can
update PATH to include to directory containing the Doxygen binary, or you can
tell Eclox where that binary is located on your system (which is in my opinion
the better solution). To do this, open eclipse's preference edition dialog
window and go into the new "Doxygen" section.
USAGE
You can create new Doxygen projects (also called doxyfiles) using the
creation wizard. Go to "File->New->Other->Other->Doxygen Configuration". Press
next and set both file location and name. Then a empty doxyfile will be
created at the specified location, the wizard automatically adds the
".Doxyfile" extension.
You should now see a file with a blue #-sign icon. This is your new
doxyfile. Double-clicking on it will open the editor. You can now browse and
edit the settings.
Once your have properly set all doxyfile fields, you can launch a
documentation build using the toolbar icon showing a blue #-sign. In
the case the button is not visible in the toolbar, your current perspective
needs to get configured. Go to "Window->Customize perspective->Commands" and
in "Available command groups" check "Doxygen". Additionnaly, you can browse
the laetest builds by clicking the down arrow right to the toolbar button.
When the documentation build starts, a new view showing the build log opens.
In its toolbar, a button named "Stop" allows you to halt the current build
process. The current build also appears in the Eclipse job progress view and
you can control the job from there.
The build toolbar action determine the next doxyfile to build depending on
the current active workbench part (editor or view) and the current selection
in that part. For example, if the active part is a doxyfile editor, the next
doxyfile to build will be the one being edited. If the active part is the
resource explorer and the current selection is a doxyfile, that doxyfile will
be next to get build. In the case the active part selection doesn't correspond
to a doxyfile, the last built doxyfile will be rebuiled. And if the build
history is empty, you will be asked for the doxyfile to build.
HTH Anybody
Never mind, worked it out my self.
First you need to create a DoxyFile (which is the configuration file) by giving the source path and the output path.
Then only you can generate the documentation by right clicking the project and selecting the "Generate Documentation".
Thanks anyway!
I just faced a problem setting the Doxygen binary path in eclox 0.8.0 settings in Eclipse on Mac OS X 10.7.
There is no way to configure the path via Eclipse-preferences->Doxygen.
The solution is to edit the preferences file manually
add a (fake) location, let's say /Applications, using the wizard mentioned above.
close Eclipse
edit this file:
$WORKSPACE/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.gna.eclox.core.prefs:
Replace the value for doxygen.default (currently eclox.core.doxygen.CustomDoxygen /Applications\n) with eclox.core.doxygen.CustomDoxygen /Applications/Doxygen.app/Contents/Resources/doxygen\n.
restart Eclipse
For MacOS user there is a very easy way to get around via the issue of the Doxygen version selection. The link that provides details is here:https://github.com/theolind/mahm3lib/wiki/Integrating-Doxygen-with-Eclipse
After installing the Eclox plugging:
1)"go to "Eclipse --> Preferences --> Oxygen"
2)"Press Shift+CMD+G then Add: "/Applications/Doxygen.app/Contents/Resources/doxygen"
3) Doxygen's version should be displayed
this might help you or any windows user trying to install eclox:
Tutorial for Installing eclox — Document Transcript
Step 1: go to eclox website (http://home.gna.org/eclox/) and to copy the update link address.Step
step 2: Insert the link into the update manager in eclipse and press OK.
Step 3: Select the Eclox item and to complete the installation.
Step 4: When the installation has done, you should select a project that you want to generate thedoxygen documents. Then, create a doxygen project for it.
Step 5: config the options. Note: You have to provide the “Input directories” correctly and to select the “Scan recursively”item. Finally, save the configuration file.
Step 6: find out the “#” and to choice “Choose Doxyfile...”.
Step 7: select a doxyfile.Step 8: wait for few seconds and the doucments will be generated.
its from this link: http://www.slideshare.net/pickerweng/tutorial-for-installing-eclox
Like claus I had to dig into the preferences file maually, because eclox 0.8.0 would just not take a good path from Eclipse Preferences file chooser.
So, edit this file: $WORKSPACE/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.gna.eclox.core.prefs and alter the given path (in my case I had to change from
doxygen.default=eclox.core.doxygen.CustomDoxygen C\:\\Programm Files\\doxygen\\bin
to this
doxygen.default=eclox.core.doxygen.CustomDoxygen C\:\\Programme\\doxygen\\bin
Hope this helps.
I find a webpage https://github.com/theolind/mahm3lib/wiki/Integrating-Doxygen-with-Eclipse where you can find more details. Especially, for Mac users, you need to Press Shift+CMD+G then Add: "/Applications/Doxygen.app/Contents/Resources/doxygen" when you configure the doxygen in eclipse before compiling .doxygfile by using Eclox.
Alternative from eclipse is to use Javadoc:
From menu (...Search Project Run...)
Project > Generate Javadoc
You should be in Java project and add comments with tags.
!!!