emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/typescript-mode 7675bab5f2 1/2: Add .tsx to auto-mode-alis


From: ELPA Syncer
Subject: [nongnu] elpa/typescript-mode 7675bab5f2 1/2: Add .tsx to auto-mode-alist
Date: Mon, 16 Jan 2023 11:00:21 -0500 (EST)

branch: elpa/typescript-mode
commit 7675bab5f2427f16424a8b531cfb10ffe29c2ef3
Author: Jon Dufresne <jon.dufresne@gmail.com>
Commit: Jon Dufresne <jon.dufresne@gmail.com>

    Add .tsx to auto-mode-alist
    
    Add out-of-the-box support for using typescript-mode on *.tsx files.
    Avoids repetitive manual configuration for end users.
---
 typescript-mode-general-tests.el | 8 ++++++++
 typescript-mode.el               | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/typescript-mode-general-tests.el b/typescript-mode-general-tests.el
index 8522eedeec..eda77f7dce 100644
--- a/typescript-mode-general-tests.el
+++ b/typescript-mode-general-tests.el
@@ -18,6 +18,14 @@
   (indent-region (point-min) (point-max) nil)
   (untabify (point-min) (point-max)))
 
+(ert-deftest auto-mode-alist-ts ()
+  (find-file (make-temp-file load-file-name nil ".ts"))
+  (should (string-equal "typescript-mode" major-mode)))
+
+(ert-deftest auto-mode-alist-tsx ()
+  (find-file (make-temp-file load-file-name nil ".tsx"))
+  (should (string-equal "typescript-mode" major-mode)))
+
 (ert-deftest indentation-reference-document-is-reflowed-correctly ()
   (with-temp-buffer
     (insert-file-contents "test-files/indentation-reference-document.ts")
diff --git a/typescript-mode.el b/typescript-mode.el
index 47f8fa90f6..b3f2824efe 100644
--- a/typescript-mode.el
+++ b/typescript-mode.el
@@ -3119,7 +3119,7 @@ Key bindings:
      (folding-add-to-marks-list 'typescript-mode "// {{{" "// }}}" )))
 
 ;;;###autoload
-(add-to-list 'auto-mode-alist '("\\.ts\\'" . typescript-mode))
+(add-to-list 'auto-mode-alist '("\\.tsx?\\'" . typescript-mode))
 
 (provide 'typescript-mode)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]