Commit graph

175 commits

Author SHA1 Message Date
Maximilian Wolff 500e58341c
Defer loading of lsp servers up to when the buffer is visible 2021-06-06 22:26:31 +02:00
Lucius Hu b395671066 javascript: refactor
- Moved backend determination to `config.el`
- Replaced unnecessary backquote construct with simple quotation
- Replaced `pcase` form with only one-arm with `when` or `unless` form
- Replaced `(when (not foo) bar)` with `(unless foo bar)`
- Replaced `(set (make-local-variable 'foo) bar)` with `(setq-local foo bar)`
- Replaccd `(cond ((eq foo) bar))` form with `(pcase (foo bar))`
2021-04-04 12:48:21 +02:00
syl20bnr 97cd83e169 Apply GPLv3 terms explicitly to all elisp files 2021-03-25 22:59:32 -04:00
syl20bnr d55a9e2e67 Update header for year 2021 2021-03-25 22:59:32 -04:00
Matthew Leach b18c87c832
[javascript] add npm-mode (#14347)
* [javascript] add npm-mode

Add npm mode to the javascript layer.  This allows easy execution of npm
commands at the project root from any javascript file in the project.

* [javascript] defer loading of npm-mode

Defer loading of the npm-mode package.

* [javascript] remove superfluous `progn'

The `:init' command is only a single command and thus doesn't need to be wrapped
in a `progn'.

* [javascript] fix typo in npm-mode docs

s/avilable/available/

* [javascript] add additional npm-mode commands

Add and document missing commands from npm-mode.
2021-02-07 07:46:06 +01:00
thanhvg e3b6464649
[core][tide][lsp] improve spacemacs/set-leader-keys-for-minor-mode and apply it to tide and lsp layers (#14141)
* [core][keybinng] improve minor mode binding

This commit added add a new function defun spacemacs/declare-prefix-for-minor-mode
and improved spacemacs/set-leader-keys-for-minor-mode.

`which-key` package recently introduced a new api
which-key-add-keymap-based-replacements which improves perfomance and allows
prefix and namings to be stored directly in keymap. This is a great improvement.

With this new api we now make change to spacemacs/declare-prefix-for-minor-mode
to manage prefix also. For example:

  (spacemacs/set-leader-keys-for-minor-mode 'lsp-mode
    "=" "format"
    "=b" #'lsp-format-buffer)

Before we had to use another api to bind prefix
spacemacs/declare-prefix-for-mode which only works on major-mode. As lsp-mode is
a minor mode this api causes a lot of problems to which-key performance. An
example is https://github.com/syl20bnr/spacemacs/issues/12455 which led to my
hack in https://github.com/syl20bnr/spacemacs/pull/12474.

The improved spacemacs/set-leader-keys-for-minor-mode will take care of both
prefix and key naming for the minor mode. This will allows us to have a better
set up for dynamic minor modes such as lsp-mode, tide-mode etc.

Also another api is created to make prefix for minor mode:
spacemacs/declare-prefix-for-minor-mode.

Usage:
(spacemacs/declare-prefix-for-minor-mode 'tide-mode "E" "errors")"

* [tide] improve prefix

* [lsp] improve prefix
2020-11-21 07:34:55 +01:00
Robert O'Connor 82ba73a1c0
update copyright to 2020 2020-09-23 21:25:01 +02:00
Fredrik Simón 85bef62e2d
[lsp] Fix lsp-diagnostics-provider name (#13956)
`lsp-diagnostic-package` was renamed to `lsp-diagnostics-provider` in
[LSP version 7.0.1](f23159a85f/CHANGELOG.org (release-701)).
2020-09-18 20:31:30 +02:00
syl20bnr 2da9682921 [javascript] Fix default value for javascript-backend
Prevent a bug where tern is installed with SPC f e R and then
directly uninstalled if one uses the lsp layer.
2020-08-29 21:35:24 -04:00
Martin Sosic 684976c993 [javascript] Add README details about linter configuration 2020-07-24 11:12:10 +02:00
Maximilian Wolff b68b44a1b1
[tern] Remove unmaintained package company-tern
Company tern is not longer on melpa and had to be removed.
See #13725 for details.
2020-07-03 01:18:40 +02:00
Maximilian Wolff 1fd90fc1dc
Update instructions for dap integration and update existing layers
The previous way of adding dap to a layer did add the mode
unconditionally to `spacemacs--dap-supported-modes` causing
dap bindings to be added also when no lsp backend was used.
2020-05-16 23:40:38 +02:00
lawr f9ffb8dc94 Avoid unnecessary packages installation of tern layer
Fixes #13530
2020-05-11 09:42:13 +02:00
Thanh Vuong c866f61fdb [javascript] proper hook setting for js-doc
move stray execution in fn into package init
2020-05-08 23:27:20 +02:00
Ivan Yonchovski c3f13d0391 Removed company-lsp in favour of company-capf
- Also removed some cquery artifacts which accidentally ended up in this PR
instead of in https://github.com/syl20bnr/spacemacs/pull/13446
2020-04-04 08:24:44 +02:00
Maximilian Wolff 437aa08ef9
[javascript] Fix broken link to tide layer 2020-03-13 00:30:03 +01:00
Maximilian Wolff f971ee7120
[typescript] Require tide layer as it is used as formatter by default
I have also updated the installation instructions as tsserver is not
longer available as single executable on npm. Also I've made sure that
modes register for tide backend only if it is really intended to.
2020-03-08 13:05:31 +01:00
Thanh Vuong 97724081bc
Tide layer
Allows use of standalone typescript server for js/ts development
Co-Authored-By: Maximilian Wolff <smile13241324@gmail.com>
2020-03-08 12:29:04 +01:00
emacspace 546f626be9
documentation formatting: Sat Feb 22 10:39:46 UTC 2020 2020-02-22 11:44:35 +01:00
duianto dd8e611158
Replace obsolete lsp-prefer-flymake with lsp-diagnostic-package 2020-02-21 23:19:20 +01:00
Maximilian Wolff f03392573a
[javascript] Fix another broken link in the documentation 2020-02-20 23:55:42 +01:00
Maximilian Wolff 58f927714b
[javascript] Fix invalid link which broke doc generation 2020-02-20 23:42:20 +01:00
Jonathan del Strother a549b9f3b6
Remove flow-type layer and add suggestions to use flow in javascript layer
It's largely (completely?) obsolete due to lsp support in the javascript layer
2020-02-01 09:33:46 +00:00
duianto 7636811b73 [javascript][doc] Add missing #+END_SCR 2020-01-04 16:01:31 +01:00
William Blasko a337d55102 Add LSP docs for JavasScript to README.org 2020-01-04 09:23:04 +01:00
Seong Yong-ju 889a40cdc3 Add eslint_d support for JavaScript, React, TypeScript modes 2019-11-22 18:03:42 +01:00
emacspace c91779aff4 documentation formatting: Fri Nov 8 16:03:53 UTC 2019 2019-11-08 16:08:22 +00:00
duianto 75b266ff39 [javascript] Document layer var: javascript-fmt-on-save
Also mention prettier as the other formatter in the features section.
And wrap some long lines.
2019-10-19 21:32:42 +02:00
wenpin a45948c759 fix typo
There are two `dap-firefox-setup` while `dap-chrome-setup` never show up
2019-10-16 21:04:14 +02:00
syl20bnr 584392bd92 [core] Fix layer dependencies based on layer variables
There was a edge case with the declaration of the `lsp` layer in `layers.el`
files.
The `hy` layer depends on the `python` layer which in turn depends on the `lsp`
layer if and only if the `python-backend` layer variable is set to `lsp`.
When the `hy` layer was declared first then it declares the `python` layer
without its layer variables, thus the `lsp` layer was not declared because the
`python-backend` variable was not set.

The fix is to gather all the layer dependencies and resolve them only after all
the used layers have been declared.

* new function `configuration-layer/declare-layer-dependencies`
* replace all calls to `configuration-layer/declare-layer` by the new function
  except for distribution layers (we declare layer dependencies right away in
  distribution layers)
2019-09-30 02:00:48 -04:00
syl20bnr ac30247811 [lsp] When used, make LSP the default backend for all supported lang
* Added a new function to each language to select the backend
* Use these new functions in all `pcase`.
2019-09-30 00:49:44 -04:00
syl20bnr 9606dd344e [dap] Refactor configuration dap config in layers
* use local-vars-hook coupled to setup function for dap
* define new private layer variable `spacemacs--dap-supported-modes` to
  configure key bindings. This allows to move the key bindings definition from
  `funcs.el` to `packages.el`
* remove duplication of DAP key bindings in READMEs by pointing to the dap layer
  documentation
* alphabetically sort package configuration
2019-09-30 00:34:26 -04:00
smile13241324 b702df7938 Make layers request lsp dependency if lsp has been selected as backend 2019-09-10 22:00:56 +02:00
emacspace 93af3927ea documentation formatting: Sat Jul 27 13:24:53 UTC 2019 2019-07-28 01:09:03 +02:00
Thanh Vuong ce30353b52 js, ts and react layers: linter option
this PR does two things for js-related layers:

(i) add option to disable lsp linter
javascript-lsp-linter for javascript and react layers
typescript-lsp-linter for typescript layer
when the value is t, lsp linter will be used in the layer
when nil, let flycheck pick up the best linters available such
as eslint

(ii) when syntax-checking(flycheck) layer is installed, then set
next-error-function value in react and javascript layers to nil, so that
spacemacs next-error, previous-error work A desciption of this issue can be
found at https://github.com/syl20bnr/spacemacs/issues/8078

Co-Authored-By: duianto <otnaiud@gmail.com>
2019-07-26 18:04:25 +02:00
Ivan Yonchovski f892ba3091 Remove the fix-lsp-company-prefix since it is no longer needed
- company-lsp is now smarter and supports fuzzy matching
2019-07-01 13:28:42 +02:00
emacspace 3d4e6fc0df documentation formatting: Sun Jun 9 19:54:33 UTC 2019 2019-06-09 22:02:10 +02:00
smile13241324 9ebf17af49 Make javascript layer adhere to REPL conventions and fix typescript doc 2019-06-09 21:21:30 +02:00
Uros Perisic eee7d20bfe Add and configure nodejs-repl package to javascript layer.
Add relevant keybindings and documentation, including a setting
`js2-include-node-externs` as a configuration variable for those that intend to
use `Spacemacs` for node projects, as it currently seems to be mostly aimed at
pure JS (https://github.com/syl20bnr/spacemacs/issues/483).
2019-06-09 18:29:08 +02:00
duianto 7dace901a2 [javascript][doc] Update key toggle live evaluation
The key binding was changed in this commit:
javascript: change key binding for repl live eval toggle
8bc9060af8

This updates the documentation.
From: SPC m s a
To:   SPC m T l
2019-06-01 14:49:27 +02:00
emacspace c7c348a676 documentation formatting: Sun May 26 20:58:52 UTC 2019 2019-05-27 01:23:35 +03:00
Anton-Latukha f6660f82d4
Switch to the new layers generator 2019-05-15 21:08:21 +03:00
Anton-Latukha ba074bc908 layers: lang: new structure: general: add pure, multi-paradigm (&js) 2019-05-15 21:04:48 +03:00
syl20bnr 6d8040f2db Replace some if by when where appropriate 2019-05-12 10:01:05 -04:00
JAremko 77c680160e Add placeholder tags 2019-05-05 20:40:47 +03:00
emacspace 6f6b064c7e documentation formatting: Sat Apr 27 00:15:28 UTC 2019 2019-04-27 02:23:35 +02:00
Trapez Breen 9665670f8e Adding format on save to javascript layer.
Adding formatting on save option to javascript layer, similar to typescript
layer. One small syntax error fix in typescript layer.
2019-04-25 20:26:07 +02:00
Thanh Vuong 9bb9038920 Move "import-js" to own layer for js based layers
Refactor import-js to its own layer import-js so it can be optional
used for the tree layers Javascript, React and Typescript layers.
2019-04-18 21:08:43 +02:00
emacspace 0b90e116f5 documentation formatting: Wed Apr 17 13:48:54 UTC 2019 2019-04-17 23:36:35 -04:00
Seong Yong-ju e48fa85d96 Add missing prefix for js2-mode 2019-04-17 15:37:15 +02:00