emacs/web: switch to typescript mode + lsp.
This commit is contained in:
parent
47500b78e3
commit
2d3ca78643
2 changed files with 28 additions and 11 deletions
|
@ -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))
|
||||
''}
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
|
@ -28,19 +28,32 @@ mkIf (elem "emacs::web-mode" config.machine.pkgs) {
|
|||
};
|
||||
js2-mode = {
|
||||
enable = true;
|
||||
};
|
||||
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)"
|
||||
mode = [
|
||||
''("\\.js\\'" . js2-mode)''
|
||||
];
|
||||
config = ''
|
||||
(setq company-tooltip-align-annotations t)
|
||||
'';
|
||||
};
|
||||
typescript-mode = {
|
||||
enable = true;
|
||||
hook = lib.optional (elem "emacs::lsp" config.machine.pkgs)
|
||||
''(typescript-mode . (lambda () (lsp)))'';
|
||||
mode = [
|
||||
''("\\.ts\\'" . typescript-mode)''
|
||||
];
|
||||
};
|
||||
# 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…
Reference in a new issue