branch: elpa/smartparens
commit ba7818a77bed01c3a6cb1938125b456d61574aee
Merge: 79a338db11 bbfec47ac2
Author: Matus Goljer <[email protected]>
Commit: GitHub <[email protected]>
Merge pull request #1171 from lerouxrgd/master
Add support for rust-ts-mode
---
smartparens-config.el | 1 +
smartparens-rust.el | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/smartparens-config.el b/smartparens-config.el
index 7bfcfe08a3..1b0d285883 100644
--- a/smartparens-config.el
+++ b/smartparens-config.el
@@ -139,6 +139,7 @@ ID, ACTION, CONTEXT."
(eval-after-load 'rst '(require 'smartparens-rst))
(eval-after-load 'ruby-mode '(require 'smartparens-ruby))
(eval-after-load 'rust-mode '(require 'smartparens-rust))
+(eval-after-load 'rust-ts-mode '(require 'smartparens-rust))
(eval-after-load 'rustic '(require 'smartparens-rust))
(eval-after-load 'scala-mode '(require 'smartparens-scala))
(eval-after-load 'swift-mode '(require 'smartparens-swift))
diff --git a/smartparens-rust.el b/smartparens-rust.el
index 42996d8438..f505861019 100644
--- a/smartparens-rust.el
+++ b/smartparens-rust.el
@@ -45,6 +45,7 @@
(require 'smartparens)
(declare-function rust-mode "rust-mode")
+(declare-function rust-ts-mode "rust-ts-mode")
(declare-function rustic-mode "rustic-mode")
(defun sp-in-rust-lifetime-context (&rest _args)
@@ -124,7 +125,7 @@ ARGS."
((eq action 'navigate)
(and (not on-comparison) (not on-fn-return-type) (not
on-match-branch))))))))
-(sp-with-modes '(rust-mode rustic-mode)
+(sp-with-modes '(rust-mode rust-ts-mode rustic-mode)
(sp-local-pair "'" "'"
:unless '(sp-in-comment-p sp-in-string-quotes-p
sp-in-rust-lifetime-context)
:post-handlers'(:rem sp-escape-quotes-after-insert))
@@ -135,6 +136,7 @@ ARGS."
;; Rust has no sexp suffices. This fixes slurping
;; (|foo).bar -> (foo.bar)
(add-to-list 'sp-sexp-suffix (list #'rust-mode 'regexp ""))
+(add-to-list 'sp-sexp-suffix (list #'rust-ts-mode 'regexp ""))
(add-to-list 'sp-sexp-suffix (list #'rustic-mode 'regexp ""))
(provide 'smartparens-rust)