diff options
author | Katharina Fey <kookie@spacekookie.de> | 2020-12-31 13:00:29 +0100 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2020-12-31 13:00:29 +0100 |
commit | 9705294eecc91638699baa9363b7c3b879903f46 (patch) | |
tree | cd67343c23d4b30a5c3cbc39b94392e883e4d138 /infra/libkookie | |
parent | 91a0a6bff79c7cf3dfd81ed8f0c5f7c8c5d9ae94 (diff) |
libkookie: emacs: setup rust lsp utilities
Diffstat (limited to 'infra/libkookie')
-rw-r--r-- | infra/libkookie/overlays/kookie/emacs/rust/default.el | 19 | ||||
-rw-r--r-- | infra/libkookie/overlays/kookie/emacs/rust/default.nix | 11 |
2 files changed, 25 insertions, 5 deletions
diff --git a/infra/libkookie/overlays/kookie/emacs/rust/default.el b/infra/libkookie/overlays/kookie/emacs/rust/default.el index 7be109575535..0dc40909d93e 100644 --- a/infra/libkookie/overlays/kookie/emacs/rust/default.el +++ b/infra/libkookie/overlays/kookie/emacs/rust/default.el @@ -1,10 +1,23 @@ -;;; +;; rust.el +;; Configure rust development via lsp and rust-analyzer +;; +;; This mode enables IDE-like integration for writing and editing rust +;; mode, as well as projectile.el, a utility to mark projects in a +;; large set of directories such as a monorepo. This mode depends on +;; all projects in this tree following the projectile conventions. +;; +;; +;; This file is part of LIBKOOKIE, a collection of nix expressions. +;; LIBKOOKIE is licensed under the GPL-3.0 (or later) -- see LICENSE (provide 'rust) -;; Use rust-analyzer for completions +;;; Use rust-analyzer for completions (setq lsp-rust-server 'rust-analyzer) -;; Start lsp mode for Rust buffers +;;; Start lsp mode for Rust buffers (add-hook 'rust-mode-hook #'lsp) +;;; Use projectile to find project roots +(projectile-mode t) +(setq lsp-auto-guess-root t) diff --git a/infra/libkookie/overlays/kookie/emacs/rust/default.nix b/infra/libkookie/overlays/kookie/emacs/rust/default.nix index bb5e5e5841fb..2c49caf06cbc 100644 --- a/infra/libkookie/overlays/kookie/emacs/rust/default.nix +++ b/infra/libkookie/overlays/kookie/emacs/rust/default.nix @@ -1,14 +1,21 @@ { buildModule, epkgs, pkgs }: +## TODO: move some of this stuff into a generic "ide" or "lsp" module! with epkgs; with pkgs; (buildModule "rust" ./. [ # lsp integration - lsp-mode lsp-ui + lsp-mode lsp-ui company + # projectile mode + projectile + # real-time diagnostigs - flycheck + flycheck pkg-info epl + # Snippet support + yasnippet + # rust specifics rust-mode rust-analyzer ]) |