Commit graph

169 commits

Author SHA1 Message Date
Henrik Lissner
5c45a9eff9
Fall back to typescript-mode for *.tsx #2252 2019-12-26 15:00:44 -05:00
Henrik Lissner
5f2e708cd7
Minor refactors and reformatting 2019-12-12 03:48:25 -05:00
johsi-k
6625ef7177 [lang/javascript] Add prefix names to JavaScript bindings (#1991)
* add prefix names to javascript bindings
* move prefixes into respective package declarations
2019-11-10 04:33:06 -05:00
Henrik Lissner
d0e3bc3455
Fix #1765: enabling tide when lsp is active 2019-09-08 19:20:42 -04:00
Henrik Lissner
ac5168f8af
lang/javascript: use-package -> use-package! #1712 2019-09-06 01:32:20 -04:00
Henrik Lissner
e996216714
Have lsp! return non-nil if successful
And fix an issue where +javascript-init-lsp-or-tide-maybe-h would
reference lsp-mode in the rare case where lsp-mode isn't defined (likely
because the user forgot to run `doom refresh` after enabling the :tools
lsp module).
2019-09-02 21:43:12 -04:00
Henrik Lissner
21883d9700
lang/javascript: fix npm-mode keybinds #1712 2019-08-28 22:41:31 -04:00
Henrik Lissner
09f077259e
lang/javascript: make npm keybinds more accessible #1712 2019-08-28 15:17:59 -04:00
Henrik Lissner
43ebba886f
lang/javascript: fix eldoc in tide-mode 2019-08-27 00:05:12 -04:00
Henrik Lissner
5454ca4c75
lang/javascript: enable eldoc-mode on tide-mode-hook 2019-08-08 10:05:39 -04:00
Henrik Lissner
c67c503392
lang/javascript: js2-idle-timer-delay = 0.1
Makes syntax highlighting update a little faster.
2019-07-29 18:57:18 +02:00
Henrik Lissner
a3e262c7ac
💥 Refactor add-hook! macro & change arg order
This update may potentially break your usage of add-hook! if you pass
the :local or :append properties to it. This is how they used to work:

  (add-hook! :append 'some-mode-hook #'do-something)

Thsoe properties must now follow the hooks, e.g.

  (add-hook! 'some-mode-hook :append #'do-something)

Other changes:
- Various add-hook calls have been renamed to add-hook! because I
  incorrectly assumed `defun` always returned its definition's symbol,
  when in fact, its return value is "undefined" (so sayeth the
  documentation). This should fix #1597.
- This update adds the ability to add multiple functions to hooks
  without a list:

    (add-hook! 'some-mode-hook
               #'do-something
               #'do-something-else)

- The indentation logic has been changed so that consecutive function
  symbols at indented at the same level as the first argument, but forms
  are indent like a defun.

    (add-hook! 'some-mode-hook
               #'do-something
               #'do-something-else)

    (add-hook! 'some-mode-hook
      (message "Hello"))
2019-07-26 20:17:29 +02:00
Henrik Lissner
76cacb5bfe
💥 Rename def-package! -> use-package!
Calling this pivotal macro "def-package!" has frequently been a source
of confusion. It is a thin wrapper around use-package, and it should be
obvious that it is so. For this reason, and to match the naming
convention used with other convenience macros/wrappers, it is now
use-package!.

Also changes def-package-hook! -> use-package-hook!

The old macros are now marked obsolete and will be removed when straight
integration is merged.
2019-07-23 12:50:45 +02:00
Henrik Lissner
060ede0e2e
General, minor reformatting across the board
And an offering of blood to our great lord Byte Compiler-sama.
2019-07-22 02:37:45 +02:00
Henrik Lissner
0a84d2f0a9
core-lib: add auto-minor-mode, revise def-project-mode!
- Adds the auto-minor-mode package to replace our in-house
  implementation.
- Merges associate! into the def-project-mode! macro because associate!
  on its own is less useful than auto-minor-mode-alist,
  auto-minor-mode-magic-alist or hooks.
- Changes the semantics of :modes and :add-hooks properties of
  def-project-mode!. Its arguments are evaluated as is; lists will need
  to be quoted.

squash! core-lib: remove associate! macro
2019-07-22 02:30:39 +02:00
Henrik Lissner
28d04a6f5f
Refactor +javascript|init-lsp-or-tide-maybe
LSP doesn't _need_ node to enable itself.
2019-06-14 18:38:18 +02:00
Henrik Lissner
ff26cf683c
lang/javascript: update hook reference
Wrong function!
2019-06-11 16:43:56 +02:00
Henrik Lissner
b3c27ebe60
lang/javscript: unify lsp & tide initialization
The goal was to enable lsp (if +lsp is enabled), failing that it would
fall back on tide. This also adds lsp+tide support for tsx files opened
in web-mode.
2019-06-11 08:00:14 +02:00
Henrik Lissner
9402d07228
lang/javascript: fix tide starting before lsp
And refactor to use ;;;###package cookies & outline-mode headings
2019-05-06 16:55:49 -04:00
Henrik Lissner
e5c8ced1a6
lang/javascript: if lsp fails, fallback to tide 2019-05-04 19:13:26 -04:00
Henrik Lissner
1c976dc0e4
Minor, general refactors
Also rename custom lookup handlers for consistency and use the new
inline :async property instead.
2019-05-02 17:57:31 -04:00
Henrik Lissner
77e4cc4d58
💥 Remove :feature category
:feature was a "catch-all" category. Many of its modules fit better in
other categories, so they've been moved:

- feature/debugger -> tools/debugger
- feature/evil -> editor/evil
- feature/eval -> tools/eval
- feature/lookup -> tools/lookup
- feature/snippets -> editor/snippets
- feature/file-templates -> editor/file-templates
- feature/workspaces -> ui/workspaces

More potential changes in the future:

- A new :term category for terminal emulation modules (eshell, term and
  vterm).
- A new :os category for modules dedicated to os-specific functionality.
  The :tools macos module would fit here, but so would modules for nixos
  and arch.
- A new :services category for web-service integration, like wakatime,
  twitter, elfeed, gist and pastebin services.
2019-04-24 18:16:04 -04:00
Eric Solomon
040cd18573 Correct Javascript module tide format mapping 2019-04-23 11:17:29 -05:00
Henrik Lissner
742687a51e
Add delq! and pushnew! macros
And move projectile configs to their respective modules (and out of
package configs).
2019-04-08 23:01:30 -04:00
chrunchyjesus
1f1e4d8d83 fix typo (#1303) 2019-04-02 15:37:52 -04:00
Henrik Lissner
3eaa57c747
Add packages.json to projectile root files #1295 2019-04-02 00:52:10 -04:00
Henrik Lissner
5e3c8c5f92
lang/javascript: fix documentation lookup
Due to how tide-documentation-at-point is designed, it isn't compatible
with lookup handlers. A better solution is needed.
2019-03-18 01:08:59 -04:00
Henrik Lissner
bf940da52a
Don't change projectile vars before it is loaded #1219 2019-03-05 19:16:08 -05:00
Henrik Lissner
843b29a4b5
Add node_modules to projectile ignored dirs 2019-03-04 20:47:26 -05:00
Henrik Lissner
eb3c569e1d
Replace +lsp|init with lsp! autodef 2019-03-02 01:34:19 -05:00
Henrik Lissner
69ed1a4a99
feature/{syntax-checker,spellcheck} -> tools/fly{check,spell} 2019-02-22 00:25:30 -05:00
Henrik Lissner
cb923eadcc
Add basic LSP support
Still needs to be documented, but includes support for the following
languages:

+ C/C++/ObjC
+ Go
+ Java
+ Javascript
+ OCaml
+ PHP
+ Python
+ Ruby
+ Scala
+ Swift
+ HTML/CSS

Relevant to #460, #716, #1186
2019-02-21 19:13:35 -05:00
Henrik Lissner
94b16cba6c
Standardize REPL commands & improve SPC o r
- SPC o r now prompts for a REPL to open when none was found for the
  current buffer.
- REPL handlers must now follow the naming convention "*/open*-repl".
  e.g. +python/open-ipython-repl, +emacs-lisp/open-repl, etc.
- +eval/open-repl has been split in two:
  - +eval/open-repl-other-window
  - +eval/open-repl-same-window
2019-02-18 01:59:56 -05:00
Henrik Lissner
7645f843ac
lang/javascript: mode-name = JS2
A shorter name looks nicer in the modeline.
2019-01-08 00:38:05 -05:00
Henrik Lissner
37cb0e178c
Make set-lookup-handlers! additive
Consecutive calls to set-lookup-handlers! would redefine *all* lookup
handlers, unsetting unspecified ones, so you were forced to redefine all
handlers, even if you only wanted to change one. No more. Its side
effects are now additive.

Also adds :async handler support, however, due to their nature, they
cannot fall back to other handlers (there's no reliable way to detect
they worked or not).

To get around this, write a blocking wrapper around the old async method
and register it as a non-async handler.
2019-01-08 00:33:38 -05:00
Henrik Lissner
681145e6b5
Defer tide-mode init until file exists
This ensures that tide-mode won't activate for file-less JS buffers,
which are error prone. But once the file is saved, it will consider
activating itself.
2019-01-05 17:49:04 -05:00
Henrik Lissner
d87fba7944
lang/javascript: remove screeps
Moved it to my private config. This is more of a customization than
something this module should offer support for.
2018-12-28 23:54:23 -05:00
Henrik Lissner
3f195614d9
Normalize :leader/:localleader keybinds
Evil states no longer apply to them. Also removes x-alt-keysym.
2018-12-23 23:54:27 -05:00
Henrik Lissner
29f119ad4d
Hook +javascript-npm-mode into typescript-mode
This way typescript projects will be aware of node_modules.
2018-12-23 16:01:37 -05:00
Manny Schneck
8f2fd970e6 lang/js: add .mjs to auto-mode-alist regex 2018-10-03 18:08:28 -05:00
Henrik Lissner
f115e4a883
lang/javascript: fix hijacked SPC in insert mode #876 2018-09-09 23:15:55 -04:00
Henrik Lissner
5c96b0a801
lang/javascript: update set-docsets! 2018-09-09 09:58:21 -04:00
Henrik Lissner
2019aaff97
lang/javascript: enable xref support in rjsx-mode 2018-09-09 09:58:21 -04:00
Henrik Lissner
c58077810d
General refactor of modules
General code and comment improvements.

Also, removed the :desc's for csv-mode because map! is currently unable
to set which-key descriptions mode-locally, and should be avoided for
anything but global keybinds. This will be fixed when General is
introduced into Doom.
2018-09-09 09:58:20 -04:00
Henrik Lissner
84abac6b69
Remove def-menu!; use :localleader keys instead
def-menu was clumsy. We could use a better UI for refactoring commands,
but they should be available via localleader keybinds in any case.
2018-09-09 09:58:18 -04:00
Henrik Lissner
10b22b9750
Merge rjsx-mode pretty-symbols with pre-existing 2018-09-03 23:56:25 +02:00
Quentin Le Guennec
37b920f461 adds common js pretty symbols for rjsx-mode 2018-09-03 16:38:11 +02:00
Henrik Lissner
3a23ff56cd
General formatting & minor refactors 2018-09-02 17:20:19 +02:00
Quentin Le Guennec
a188ba9a1e adds npm-mode for javascript module 2018-09-01 01:48:15 +02:00
Henrik Lissner
a1a66f5445
lang/javascript: improve project file detection
+javascript-npm-mode now uses a better search for package.json, making
extra sure that your local node_modules folder is added to exec-path.
2018-08-31 02:53:50 +02:00