Commit Graph

201 Commits

Author SHA1 Message Date
a70e634ebd refactor(:lang): move tree-sitter init
Moved add-hook calls (for tree-sitter initialization) into their
respective modes' config blocks, or nearby, to be consistent with how
other, similar tools (like lsp!) are initialized, and does so at
runtime, rather than at expansion/compile time, which eval-when! caused.
2022-07-25 17:34:44 +02:00
5eed2e9e61 fix(javascript): guard evil-textobj-tree-sitter setting
For non-evil users.
2022-06-18 15:01:13 +02:00
0074dc415b nit(javascript): use issue shorthand 2022-05-22 21:26:09 +01:00
7f814e5d99 refactor(:lang): redo tree-sitter hooks
- bind to major-mode-local-vars-hook instead of major mode hook
- bind the autodef tree-sitter! instead of the functions.
2022-05-22 21:26:08 +01:00
955e2d461b nit(javascript): add hook to end of rjsx-mode 2022-05-22 21:26:06 +01:00
e9f98001c1 feat(tree-sitter): support typescript-tsx-mode 2022-05-22 21:26:05 +01:00
0c2f986708 feat(:lang): enable ts text objs in modes 2022-05-22 21:26:03 +01:00
06ed5ade3f refactor!(tree-sitter): add +tree-sitter flag
BREAKING CHANGE: break the global nature of the tree sitter
module by adding a +tree-sitter flag to every applicable module

In the background this hooks turn-on-tree-sitter-mode
to the major-mode-hook of the language.
This may also solve the eager loading of tree sitter
2022-05-22 21:26:00 +01:00
4538225fc5 fix(javascript): void-function typescript-tsx-mode
Caused when you have :lang web disabled, but :lang javascript enabled.
This is a stopgap until I decide what to do with typescript-tsx-mode.

Fix: #6243
2022-04-08 02:51:50 +02:00
9d1513af46 bump: :core
bbatsov/projectile@0243ad7dc9 -> bbatsov/projectile@f3468e8d20
domtronn/all-the-icons.el@2c963ebb75 -> domtronn/all-the-icons.el@65c496d3d1
jscheid/dtrt-indent@926fc4260c -> jscheid/dtrt-indent@66fc30af02
raxod502/straight.el@653b04a64f -> raxod502/straight.el@e2de88ea0e
2022-03-30 17:49:35 +02:00
8746da61c3 fix(javascript): incorrect lsp formatting for tsx
lsp-mode doesn't detect the correct indentation, since it treats the
derived tsx-mode as a web-mode. This change modifies the lsp-mode
internal alist to recognize tsx-mode correctly. Ideally lsp-mode would
have a better way to modify its known mode lists but I couldn't see it.

Ref: emacs-lsp/lsp-mode#3308
2022-01-13 21:51:07 +01:00
3c79078634 fix(javascript): emmet-expand-jsx-className? = t
So emmet expands class snippets to className="..." instead of
class="...".

Fix #5556
2021-10-03 12:23:42 +02:00
68bee5043c Fix 'typescript-tide is not a valid syntax checker' error 2021-05-26 17:04:06 -04:00
657b326e92 lang/javascript: redesign module around rjsx-mode
+ Use rjsx-mode for all javascript files. It degrades gracefully and is
  less maintenance.
+ Rethink flycheck + JS integration. You should get eslint and tslint
  support in web-mode, typescript-mode, and typescript-tsx-mode now (as
  well as rjsx-mode, of course).
2021-05-26 16:19:04 -04:00
9ae4945d97 Enable docsets in nodejs-repl-mode 2021-05-21 22:55:49 +07:00
ac46ae7eb3 Associate *.cjs (commonjs module) with js2-mode 2021-03-21 00:42:49 -04:00
61a6be264e Associate *.es6 files with js2-mode 2021-02-05 04:45:53 -05:00
ecc6fcd8d5 Bump :lang javascript
ananthakumaran/tide@f0b6dac -> ananthakumaran/tide@fa617f5

New version of tide.el introduces xref backend.
2020-09-01 13:53:07 +03:00
7081d833f6 Move :ui pretty-code to :ui ligatures
Includes a major refactor of the module.
2020-08-20 02:14:32 -04:00
63113ff6ce lang/javascript: Enable TSLint and ESLint for TypeScript-TSX 2020-05-31 00:57:38 +09:00
348d5751fd Fix #3041: void-function +javascript-init-tide-or-lsp-maybe-h error 2020-05-05 12:25:07 -04:00
8ae7bf0ef1 Fix tide not working with rjsx-mode
Tide doesn't work with rjsx-mode after changing to *-mode-local-vars-hook.
Fixed by adding +javascript-init-lsp-or-tide-maybe-h for
rjsx-mode-local-vars-hook as well.

Signed-off-by: Huy Duong <huy.duong@employmenthero.com>
2020-05-04 15:28:03 +07:00
b7836322f6 Refactor tide-mode's lookup handlers
The remap bypass is no longer necessary.
2020-04-23 23:56:17 -04:00
daec7b5057 Remove eslintd-fix package
This package isn't hooked up to anything and has no keybinds. Its config
is so trivial that users can install it themselves, so I decided it
won't be included with the module by default.
2020-04-23 23:56:17 -04:00
28ec59cd20 lang/javascript: start tide/lsp later
Gives direnv and other mode hooks a chance to set up the environment
first.
2020-04-23 23:56:17 -04:00
17dd1c6527 Add add-node-modules-path package to lang/javascript
And use it on json-mode.
2020-04-23 23:28:50 -04:00
169f9a6121 General, minor refactor & reformatting 2020-03-27 01:25:30 -04:00
c1046231ce Fix #1792: tide-server-max-response-length = 512kb 2020-03-14 22:00:59 -04:00
9816209484 Fix wrong-type-arg errors in ediff+web-mode buffers 2020-02-27 11:29:50 -05:00
10623868b8 Fix #2567: unbound js2-refactor keybinds 2020-02-19 23:41:39 -05:00
f31840ac9e Improve solidity layer
Enable +javascript-npm-mode in solidity-mode when package.json exists.
Set docsets for solidity-mode.
2020-01-29 23:59:45 +09:00
12094788d7 Fix references to :tools fly{spell,check} 2020-01-14 03:04:26 -05:00
5c45a9eff9 Fall back to typescript-mode for *.tsx #2252 2019-12-26 15:00:44 -05:00
5f2e708cd7 Minor refactors and reformatting 2019-12-12 03:48:25 -05:00
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
d0e3bc3455 Fix #1765: enabling tide when lsp is active 2019-09-08 19:20:42 -04:00
ac5168f8af lang/javascript: use-package -> use-package! #1712 2019-09-06 01:32:20 -04:00
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
21883d9700 lang/javascript: fix npm-mode keybinds #1712 2019-08-28 22:41:31 -04:00
09f077259e lang/javascript: make npm keybinds more accessible #1712 2019-08-28 15:17:59 -04:00
43ebba886f lang/javascript: fix eldoc in tide-mode 2019-08-27 00:05:12 -04:00
5454ca4c75 lang/javascript: enable eldoc-mode on tide-mode-hook 2019-08-08 10:05:39 -04:00
c67c503392 lang/javascript: js2-idle-timer-delay = 0.1
Makes syntax highlighting update a little faster.
2019-07-29 18:57:18 +02:00
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
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
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
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
28d04a6f5f Refactor +javascript|init-lsp-or-tide-maybe
LSP doesn't _need_ node to enable itself.
2019-06-14 18:38:18 +02:00
ff26cf683c lang/javascript: update hook reference
Wrong function!
2019-06-11 16:43:56 +02:00
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