From 30107eeb1e5765c999f5a82a98ba03a11afa1fb7 Mon Sep 17 00:00:00 2001 From: JaeYoo-Im Date: Wed, 4 Sep 2024 18:08:39 +0900 Subject: [PATCH] emacs : rustic to rust-mode --- .config/emacs/lisp/init-rust.el | 51 +++++++++------------------------ 1 file changed, 13 insertions(+), 38 deletions(-) diff --git a/.config/emacs/lisp/init-rust.el b/.config/emacs/lisp/init-rust.el index 3b05a41..0204915 100644 --- a/.config/emacs/lisp/init-rust.el +++ b/.config/emacs/lisp/init-rust.el @@ -1,49 +1,24 @@ ;; init-rust.el --- Initialize Rust configurations. -*- lexical-binding: t -*- -;; Copyright (C) 2019-2022 Vincent Zhang - -;; Author: Vincent Zhang -;; URL: https://github.com/seagle0128/.emacs.d - -;; This file is not part of GNU Emacs. -;; -;; This program is free software; you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation; either version 3, or -;; (at your option) any later version. -;; -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. -;; -;; You should have received a copy of the GNU General Public License -;; along with this program; see the file COPYING. If not, write to -;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth -;; Floor, Boston, MA 02110-1301, USA. -;; - -;;; Commentary: -;; -;; Rust configurations. -;; - -;;; Code: - ;; Rust -(use-package rustic + +(use-package rust-mode :straight t :ensure t :defer t - :init - (if ON-LINUX - (setq rustic-analyzer-command '("~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rust-analyzer")) - (setq rustic-analyzer-command '("~/.rustup/toolchains/stable-x86_64-pc-windows-msvc/bin/rust-analyzer.exe"))) - (setq rustic-lsp-client 'eglot)) -(use-package rust-playground + :config + (flycheck-rust-setup)) +(use-package cargo :straight t :ensure t - :defer t) + :defer t + :after rust-mode) +(use-package flycheck-rust + :straight t + :ensure t + :after (flycheck rust-mode) + :config + (add-hook 'flycheck-mode-hook #'flycheck-rust-setup)) (use-package toml-mode :straight t :ensure t