Browse Source

emacs/web: switch to typescript mode + lsp.

master
Kevin Baensch 2 months ago
parent
commit
2d3ca78643
Signed by: derped GPG Key ID: C0F1D326C7626543
  1. 4
      pkgsets/emacs/lsp.nix
  2. 31
      pkgsets/emacs/web-mode.nix

4
pkgsets/emacs/lsp.nix

@ -18,6 +18,10 @@ mkIf (elem "emacs::lsp" config.machine.pkgs) {
${optionalString (elem "emacs::rust" config.machine.pkgs) ''
(setq lsp-rust-clippy-preference "on")
''}
${optionalString (elem "emacs::web-mode" config.machine.pkgs) ''
(setq lsp-clients-deno-enable-unstable 't)
(setq lsp-disabled-clients '(ts-ls))
''}
'';
};

31
pkgsets/emacs/web-mode.nix

@ -28,19 +28,32 @@ mkIf (elem "emacs::web-mode" config.machine.pkgs) {
};
js2-mode = {
enable = true;
mode = [
''("\\.js\\'" . js2-mode)''
];
};
tide = {
typescript-mode = {
enable = true;
after = [ "typescript-mode" "company" "flycheck" ];
hook = [
"(typescript-mode . tide-setup)"
"(typescript-mode . tide-hl-identifier-mode)"
"(before-save . tide-format-before-save)"
hook = lib.optional (elem "emacs::lsp" config.machine.pkgs)
''(typescript-mode . (lambda () (lsp)))'';
mode = [
''("\\.ts\\'" . typescript-mode)''
];
config = ''
(setq company-tooltip-align-annotations t)
'';
};
# tide = {
# enable = true;
# after = [ "typescript-mode" "company" "flycheck" ];
# hook = [
# "(typescript-mode . tide-setup)"
# "(typescript-mode . tide-hl-identifier-mode)"
# "(before-save . tide-format-before-save)"
# ];
# config = ''
# (flycheck-mode +1)
# (setq flycheck-check-syntax-automatically '(save mode-enabled))
# (setq company-tooltip-align-annotations t)
# '';
# };
impatient-mode = {
enable = true;
};

Loading…
Cancel
Save