Commit Graph

136 Commits

Author SHA1 Message Date
lawrsp 43d76ebe42
fix(typescript) fix ts init process with .tsx files (#15885)
fixes https://github.com/syl20bnr/spacemacs/issues/15217
fixes https://github.com/syl20bnr/spacemacs/issues/15412
2023-01-09 23:14:49 +00:00
Arif Er 00f9ab19ac chore: update copyright headers to 2022
The script used to identify and update the change is added into the GitHub
workflows script directory. A workflow action can be created to trigger the
script to update the headers on the first of every new year. Possibly a task for
a consequent PR.
2022-06-03 17:32:20 +02:00
Maximilian Wolff 500e58341c
Defer loading of lsp servers up to when the buffer is visible 2021-06-06 22:26:31 +02:00
ralph-cheng a6fc48dba4
bug fix - eslint not available for typescript-tsx-mode (#14685) 2021-04-21 11:04:51 -04:00
Lucius Hu b1f54b3371 typescript: 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)`
- Replaccd `(cond ((eq foo) bar))` form with `(pcase (foo bar))`
- Replaced `(set (make-local-variable 'foo) bar)` with `(setq-local foo bar)`
- Replaced `(if foo bar nil)` with `(when 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
Maximilian Wolff 6018580958 Make layers activate/deactivate the right version of smartparens
Before layers were sometimes only activating the non strict
version of smartparens. Also some were only disabling
the non-strict version leaving some of the smartparens
advices intact.

With this PR, all layers set the right version of smartparens.
Also if the layer is trying to disable it a standard function
will now take care to disable all versions of smartparens.
2021-03-16 17:47:15 +00:00
Maximilian Wolff 37008c07c4
[typescript] Restore format bindings for `typescript-tsx-mode` 2021-02-23 22:17:44 +01:00
Maximilian Wolff 98176b130c
[typescript] Cleanup bindings to avoid duplicate code 2021-02-22 22:32:11 +01:00
Cheng, Rong 1f1ed2a976
Add typescript-format keybinding in typescript-tsx-mode
typescript-format is bound to leader-key == in typescript-mode, but not
in typescript-tsx-mode.
2021-02-22 22:08:30 +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
NANASHI0X74 efcab8f61a
Bind typescript-format to "==" or "=" depending on backend (#14049)
* Bind typescript-format to "==" or "=" depending on backend

This fixes a problem when using 'lsp backend: the lsp layer binds its own
formatting functions under "=" as a prefix. The spacemacs/typescript-format
function which the typescript layer defines has advantages over these, mainly
it respects the typescript-fmt-tool variable (uses the formatting tool that
theuser specified).

This patch solves this by keybinding leader+"==" to the function when
typescript-backend is set to 'lsp and binding to leader+"=" in any other case.

* Fix an accidentally deleted keybinding in table in documentation

* use getter for backend variable

Co-authored-by: nanashi0x74 <rian.lindenberger@mpq.se>
2020-10-17 10:17:41 +02: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
Maximilian Wolff 15d93914f5
Fix "lsp is no valid syntax checker" error message
See #13841
2020-08-27 00:04:53 +02:00
Tommi Komulainen f57ebbb994 [typescript] configure tslint also for lsp backend 2020-07-28 15:34:27 +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 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
duianto dd8e611158
Replace obsolete lsp-prefer-flymake with lsp-diagnostic-package 2020-02-21 23:19:20 +01:00
Brian Wignall 4df6c9035f
Fix typos 2019-12-05 22:23:04 +01:00
Arjan Singh 4e9d62b80d fix(+lang/typescript): correct readme typos 2019-12-05 06:30:24 +01:00
Seong Yong-ju 889a40cdc3 Add eslint_d support for JavaScript, React, TypeScript modes 2019-11-22 18:03:42 +01:00
smile13241324 7a83b5a7ad Remove javascript-eslint from next checker for lsp-ui
To activate javascript-eslint all lsp layers where
running eslint during lsp-ui flycheck phase. This
caused a lot of side effects and has been deactivated
for now. Eslint shall be called by the lsp server instead.
2019-11-15 00:27:38 +01:00
alex argunov 92b7b65d13 Add available formatters to typescript readme 2019-10-18 22:39:44 +02:00
Aaron Jensen 1bd3777006 Fix tide with tsx files
This was broken in
ac30247811
if you do not specify a backend explicitly
2019-10-18 20:36:05 +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
smile13241324 b702df7938 Make layers request lsp dependency if lsp has been selected as backend 2019-09-10 22:00:56 +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
Ryan f1d55ed002 Add eslint as option for linting typescript 2019-06-09 17:59:01 +02:00
Seong Yong-ju 59504029b1 Configure emmet-mode for typescript-tsx-mode 2019-05-31 17:57:37 +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
JAremko 77c680160e Add placeholder tags 2019-05-05 20:40:47 +03: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
trapez.breen a8b7c0d591 Adding the same setup to typescript-tsx files as to typescript files.
Changed typescript major mode formating to "=".
2019-04-17 00:13:58 +02:00
Jam Risser 89047e4707 Fixed typescript/jump-to-type-def when npm module 2019-01-20 17:22:04 +02:00
Justin f8bb6997a9 Remove lsp-javascript-typescript package for lsp built in.
Remove lsp-go package for lsp built in.
Changed go/react/typescript lsp-*-enable hooks to lsp
Update go/typescript/rust layer docs for lsp-mode installation command.
Remove unused rust layer variable
2019-01-15 00:41:30 +02:00
Aaron Jensen c9eacd1f7e typescript: Fix jump handlers in tsx 2019-01-15 00:32:46 +02:00
emacspace 45276bd96f documentation formatting: Wed Dec 5 03:03:03 UTC 2018 2018-12-04 22:06:14 -05:00
Aaron Jensen d52883fc56 typescript: Fix jump handling with multiple backends
Because the setup functions run after local vars are set, setting jump handlers
needs to happen directly. Otherwise setting them only applies to the next
typescript file that is opened, which may or may not even have the same backend.

Also prevents lsp jump handlers from being installed unless the backend is lsp.
2018-11-20 11:34:24 +00:00
Stéphane Bisinger 8db682fc6d
Fix the rename file and organize import key binding for typescript 2018-10-16 09:19:24 +03:00
emacspace cca6bc15a8 documentation fixes:Sat Oct 13 23:09:18 UTC 2018 2018-10-13 23:09:18 +00:00