2019-11-17 23:13:50 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
mkIf (elem "emacs::lsp" config.machine.pkgs) {
|
|
|
|
programs.emacs.init.usePackage = {
|
|
|
|
lsp-mode = {
|
|
|
|
enable = true;
|
|
|
|
command = [ "lsp-mode" ];
|
|
|
|
config = ''
|
2020-03-23 10:10:31 +01:00
|
|
|
(setq lsp-keymap-prefix "C-c")
|
2019-11-17 23:13:50 +01:00
|
|
|
(setq lsp-eldoc-render-all nil)
|
|
|
|
|
|
|
|
(defvar lsp-language-id-configuration '(
|
2020-03-23 10:10:31 +01:00
|
|
|
${optionalString (elem "emacs::rust" config.machine.pkgs)
|
|
|
|
''(rust-mode . "rust")''}
|
2019-11-17 23:13:50 +01:00
|
|
|
))
|
2020-03-27 13:05:57 +01:00
|
|
|
${optionalString (elem "emacs::rust" config.machine.pkgs) ''
|
|
|
|
(setq lsp-rust-clippy-preference "on")
|
|
|
|
''}
|
2021-11-25 22:13:28 +01:00
|
|
|
${optionalString (elem "emacs::web-mode" config.machine.pkgs) ''
|
|
|
|
(setq lsp-clients-deno-enable-unstable 't)
|
2022-01-22 12:12:46 +01:00
|
|
|
(setq lsp-clients-deno-import-map "./import_map.json")
|
|
|
|
(setq lsp-clients-deno-config "./deno.json")
|
2021-11-25 22:13:28 +01:00
|
|
|
(setq lsp-disabled-clients '(ts-ls))
|
|
|
|
''}
|
2019-11-17 23:13:50 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
lsp-ui = {
|
|
|
|
enable = true;
|
|
|
|
after = [ "lsp" ];
|
|
|
|
command = [ "lsp-ui-mode" "lsp-ui-sideline-mode" ];
|
|
|
|
config = ''
|
|
|
|
(setq lsp-ui-sideline-enable t
|
|
|
|
lsp-ui-sideline-show-symbol nil
|
|
|
|
lsp-ui-sideline-show-hover nil
|
|
|
|
lsp-ui-sideline-show-code-actions t
|
|
|
|
lsp-ui-sideline-update-mode 'point)
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
lsp-ui-flycheck = {
|
|
|
|
enable = true;
|
2020-03-23 10:10:31 +01:00
|
|
|
package = epkgs: [ epkgs.lsp-ui ];
|
2019-11-17 23:13:50 +01:00
|
|
|
after = [ "lsp-ui" ]
|
|
|
|
++ optional (elem "emacs::flycheck" config.machine.pkgs) "flycheck";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|