branch: elpa/smartparens
commit bbfec47ac29ae93d9bbfe4e1fd1aa0c9e35e8397
Author: Romain Leroux <rom...@leroux.dev>
Commit: Romain Leroux <rom...@leroux.dev>

    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)

Reply via email to