help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to get decent java-script support


From: Rasmus
Subject: How to get decent java-script support
Date: Thu, 25 Jun 2015 03:23:16 +0200
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux)

Hi,

I have been working with d3.js.  I'd prefer to retain the same workflow as
with other programming languages, namely having source-code and REPL in
Emacs.

I have tried js and js2 mode.  However, I don't like indentation of these
two modes, including when js2-bounce-indent-p is non-nil.  I cannot get
indentation to respect the "chain-syntax" of d3 (supposedly also used by
jQuery).  Also, it inserts lots of newlines e.g. for "{}" pairs, which is
annoying for inline functions (e.g. in .map arguments).  I tried to turn
off electricity, but that didn't make it stop with the excessive newlines.

Some question on JS in Emacs:

First, is it possible to get js(2) mode to allow chain-style indentation
and be less, or more, clever about braces and semicolons?

Second, can one somehow connect hook into some sort of documentation
system with java-script?  At least for standard ECMAScript?  Like
"help(fun)" in Python and C-h for Emacs Lisp etc etc.  At this point, I
could even live with it "just" opening Mozilla dev. pages in eww or
Firefox.

Third, related to two, can eldoc somehow be taught to work with JS?

Fourth, REPL.  I tried skewer-mode.  It was OK.  But not great compared to
the REPL in Firefox.  For instance, auto-completion (M-TAB) did not work
at all.  It seems it has some completion support with auto-complete.
Really, I just want M-tab completion...

I would appreciate any hints.

Thanks,
Rasmus


PS: Other modes I tried.

Web-Mode: Indentation seems to work perfectly, and the fact that it can
handle JS, HTML and CSS in one buffer is awesome, but it's too opinionated
in weird areas.  Coloring does not following the normal color names, key
movements do not respect {sub,super}-word-mode, and it uses "/* ⋯ */"
commenting instead of "// ⋯", making comment-dwim not working....

I tried something called tern since it supposedly offer completion for
company.  I don't remember why I dropped it...

I haven't tried js-comint or MozRepl.  Maybe they provide better REPL
experience?

-- 
A clever person solves a problem. A wise person avoids it




reply via email to

[Prev in Thread] Current Thread [Next in Thread]