Alex Fitzpatrick wrote:
Just by way of introduction, I'm currently the principal developer and
maintainer of the a JavaScript editor plug-in for Eclipse.
Thank you, and keep up the good work.
[https://sourceforge.net/projects/jseditor/ The plug-in as it stands
supports syntax highlighting and outlining of functions, classes and
their methods.]
When I took over the project in June it was for the purpose of adding
outlining facilities for JavaScript written in an OO style with classes
and so on. I have since discovered, to both my delight and horror, that
there are a variety of ways of accomplishing OO in JavaScript.
And there are no classes in JavaScript 1.x.
I was wondering if any of those people currently involved in large
JavaScript projects might be willing to provide me with some input on:
- the style they use
You need to be more specific. For now, read my postings here and in
de.comp.lang.javascript (if you can manage it), have a look at
http://pointedears.de.vu/scripts/ and feed the scripts to the plugin.
- what kind of editor support they would find useful
More and more reliable syntax highlighting, see my library
documentations (.htm) for examples (they use the style.css
file). With eclipse 3.0M4 and JSEditor 0.3.3, which I
understand for the latter is the latest release, the plugin
tends to forget where syntax highlighting should be applied.
Example: I often type
var foobar
where `var' is sometimes not hightlighted. When I then remove
the `v' and include it again, the keyword is finally highlighted.
Only constructor functions where the `this' special operator is
used are considered constructor functions by the plugin (then
falsely displayed as (C)lass in the Outline view). This is
obviously caused by the misguided attempt to impose class-based
terminology over a prototype-based language (see my other posting).
A function should be at least considered a constructor function if
it contains the `this' operator or is called with the `new' operator.
Example: math.js, where Exception is considered a "class" while
specialized exception functions are not, even if they are called
with the `new' operator in common functions.
When properties are unconditionally added to the prototype property
of an object, they should also appear as properties in the Outline
view.
A built-in JavaScript beautifier (and uglyfier ;-)) is needed.
Unlike the Java Editor's formatter, which was IIRC usable for
formatting JavaScript until eclipse 3.0M3, it needs to pay
attention to dynamic HTML, so that `<' within a string is not
considered an operator aso.
It would be nice if one could create a coder's documentation from
JavaScript source using special comments, like JavaDoc and PHPdoc
already do. Thus I have recently developed JavaScriptDoc[tm]:
http://pointedears.de.vu/scripts/JSDoc/
A working implementation of it in JavaScript (using quite cruel RegExp
parsing) is underway, but as the eclipse platform may already provide a
parser suitable for JavaScriptDoc, I would be glad if it could be part
of the JSEditor plugin once possible syntax inconsistencies have been
resolved.
These are my suggestions so far.
(Unlike your From header, headers of my postings conform to Internet
standards, and) I also welcome replies via electronic mail.
PointedEars