rust: bring back old config if Emacs version less than 26
This commit is contained in:
parent
7ee7f05468
commit
aa4239659a
35
init.el
35
init.el
@ -654,19 +654,23 @@ inserted between the braces between the braces."
|
|||||||
|
|
||||||
;;; ### Rust ###
|
;;; ### Rust ###
|
||||||
|
|
||||||
;;; If you have [Rustup](https://www.rust-lang.org/learn/get-started)
|
;;; If you have Emacs 26 than you need
|
||||||
;;; than you should install component `rls` with the command
|
;;; [Rustup](https://www.rust-lang.org/learn/get-started) and using
|
||||||
|
;;; Rustup you should install component
|
||||||
|
;;; [rls](https://github.com/rust-lang/rls) with the command
|
||||||
;;;
|
;;;
|
||||||
;;; ```
|
;;; ```
|
||||||
;;; $ rustup component add rls
|
;;; $ rustup component add rls
|
||||||
;;; ```
|
;;; ```
|
||||||
;;;
|
;;;
|
||||||
;;; and then add to config file
|
;;; and then add
|
||||||
|
|
||||||
(use-package lsp-mode
|
(use-package lsp-mode
|
||||||
|
:if (>= emacs-major-version 26)
|
||||||
:commands lsp)
|
:commands lsp)
|
||||||
|
|
||||||
(use-package rustic
|
(use-package rustic
|
||||||
|
:if (>= emacs-major-version 26)
|
||||||
:init
|
:init
|
||||||
(setq company-tooltip-align-annotations t
|
(setq company-tooltip-align-annotations t
|
||||||
rustic-format-on-save t)
|
rustic-format-on-save t)
|
||||||
@ -674,6 +678,31 @@ inserted between the braces between the braces."
|
|||||||
(:map rustic-mode-map
|
(:map rustic-mode-map
|
||||||
("C-i" . company-indent-or-complete-common)))
|
("C-i" . company-indent-or-complete-common)))
|
||||||
|
|
||||||
|
;;; But if you have Emacs older than 26 than you should install
|
||||||
|
;;; [racer](https://github.com/racer-rust/racer) and add
|
||||||
|
|
||||||
|
(use-package cargo
|
||||||
|
:if (< emacs-major-version 26)
|
||||||
|
:defer)
|
||||||
|
|
||||||
|
(use-package racer
|
||||||
|
:if (< emacs-major-version 26)
|
||||||
|
:defer)
|
||||||
|
|
||||||
|
(use-package rust-mode
|
||||||
|
:if (< emacs-major-version 26)
|
||||||
|
:init
|
||||||
|
(setq company-tooltip-align-annotations t
|
||||||
|
rust-format-on-save t)
|
||||||
|
:config
|
||||||
|
(add-hook 'rust-mode-hook #'company-mode)
|
||||||
|
(add-hook 'rust-mode-hook #'cargo-minor-mode)
|
||||||
|
(add-hook 'rust-mode-hook #'racer-mode)
|
||||||
|
(add-hook 'racer-mode-hook #'eldoc-mode)
|
||||||
|
:bind
|
||||||
|
(:map rust-mode-map
|
||||||
|
("C-i" . company-indent-or-complete-common)))
|
||||||
|
|
||||||
|
|
||||||
;;; ### Language server with Vala support ###
|
;;; ### Language server with Vala support ###
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user