Liclipse - Javascript - eclipse

In the pydev liclipse editor how do add javascript folders so that it doesn't show errors in javascript files, such as $ is undefined (doesn't know jquery is also loaded when file is run).
I have tagged it with eclipse but this is a fork built around pydev "liclipse" so i don't see "javascript" as a project type.
TIA

Well, the LiClipse validator currently integrates JSHint internally (with Rhino), and there's no option to disable it...
Still, you can add a comment to the top of the file so that it knows that some symbols are expected to be undefined.
I.e.: if you add:
/*global $:false,alert:false*/
to the top of your file, the $ and alert symbols won't be triggered as not-defined.

I don't know anything about liclipse, so can't be certain my answer is correct. But I'd guess you will need to install some Javascript tooling in order to properly handle javascript code and projects. The options for Eclipse are not great, but there are JSDT and VJet.

Related

Perl IDE Padre: how to format the source code

How can I have something like in eclipse, highlight the lines, right click Source --> Format, and make the code line up nicely.
There is a tool called Perl::Tidy which is highly configurable that does auto formatting of Perl code. Padre has a plugin to use it. You can find the documentation here.
Padre has a plugin called Padre::Plugin::PerlTidy that provides integration with the above module. It uses the default settings of perltidy or the settings of the current project to tidy the current file or the current selection in the editor.
It probably will use the .perltidyrc config file in your project directoy, though I am note sure about that.
Finally I figured out. First download the plugin gzip from here: search.cpan.org/~azawawi/Padre-Plugin-PerlTidy-0.22/lib/Padre/…, then install it from Tools --> Module Tools --> Install Local Distribution. Then from Tools --> Plugin Manager, enable the Perl Tidy. Finally I can see this menu: Tools/Perl Tidy/Tidy the Active Document, as mentioned here padre.perlide.org/features/perl-tidy.html.

xdebug/netbeans won't stop at any breakpoint other than in Joomla index.php

I'm a newbie with IDEs, I used Eclipse so far but more like an fancy text editor. I now switched to Netbeans and set it up for Joomla extension development, for which I followed the steps in various tutorials.
Everything works great except debugging. I set up xdebug and it works if I have breakpoints in the Joomla index.php file, but breakpoints in the php files of my component (for example in on e of the model functions) were just ignored.
My setup:
Joomla 2.5
Netbeans 7.4
XAMPP 3.1
xdebug
In both eclipse and netbeans, a prerequisite for debugging is that the project is built.
"Building" doesn't do anything real: php code is not compiled. But it allows the IDE to build a dependency tree, validate the code, allow code completion and follow execution flow from one class to the next.
To build, in eclipse either right click on the project or choose Project/Build from the menu. I have set Build automatically so the resources stay in sync while I work:
I encountered with the same problem, but solution is rather tricky. Actually netbeans stops on breakpoints but no all lines are eligible for breaking. When you put breakpoint wait a little, if beside green square there appears black arrow pointing down then it is OK, otherwise try some other line.

jade templating syntax support for eclipse?

I have just starting using the nodejs templating engine jade. Unfortunately my IDE eclipse doesn't seem to have support for this syntax and is not highlighting correctly.
Is it possible to add support for .jade files to eclipse?
As current lead of Nodeclipse effort www.nodeclipse.org I announce that Nodeclipse v0.12 has added Minimalist Jade Editor, see http://www.nodeclipse.org/history. Added just before release as I got sick of .jade to be opened outside of Eclipse.
#134 - Minimalist Jade Editor
idea is to define HTML tags and JavaScript keywords as words for highlight in Word.java
and then use it together with EditBox
Nodeclipse scope is growing, now it has Gradle for Android and JavaScript in general that I want to work on for next iteration. Also looking for developers and company willing to support the project. Raise an issue on GitHub/Nodeclipse to continue.
check if this helps
Jade-syntax-highlight
Follow the pattern used for adding HAML support to an Eclipse install, and find a lexer and colorizer for Jade.

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.

Eclipse "go to definition" problem

I'm using PyDev for eclipse and am experiencing some issues with "go to definition". It works for most modules, but for some site packages it does not. It does the "bump" sound and then nothing happens. One of the packages that doesn't work is Twisted, which is weird since the source is included and right there. Any idea how to fix this?
The go to definition works just fine. The problem was that eclipse didn't know where to find the source. You can go to window > preferences > pydev > interpreter > New folder, and add the folders missing. Even though you've added site-packages to the configuration, you still have to add subfolders separately to get code assist and to be able to go to the definition.
Pydev (also bundle with the Aptana distro) does not seem to have any bug exactly similar to the one you are describing.
Here is the list of bugs including the word "definition" for PyDev: bugs
You could open a bug report there with the exact version of eclipse, pydev, java used
But first:
What version of Pydev are you using? The open-source one or the commercial one (i.e. open-source + Pydev extensions)?
Because the matrix feature is quite clear:
Feature List Pydev "Open Source" Pydev Extensions
---------------------------------------------------------------
Go to definition BRM* Pydev Extensions(2)
BRM*: Bicycle Repair Man is an open-source program that provides 'go-to-definition' and refactoring. Its 'go-to-definition' only works for Python, and only works 'well' for global or local tokens (does not work very well on methods from parameters or on 'self'). It is currently 'unsupported'.
Pydev Extensions (2): Pydev extensions provides a 'go-to-definition' that works for python and jython, and should work even on methods from parameters and 'self'.