[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master a3d8da2476 7/7: Make typescript-ts-mode not fallback to js-mode
From: |
Yuan Fu |
Subject: |
master a3d8da2476 7/7: Make typescript-ts-mode not fallback to js-mode |
Date: |
Sat, 26 Nov 2022 21:36:30 -0500 (EST) |
branch: master
commit a3d8da24762bc7ecc5bad9275ecc0a6d5f3ac7c3
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>
Make typescript-ts-mode not fallback to js-mode
1. js-mode might not be able to handle typescript file
2. Now that we use separate modes for tree-sitter modes, not falling
back makes tree-sitter modes more consistent
* lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode): Remove
the fallback code.
---
lisp/progmodes/typescript-ts-mode.el | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/lisp/progmodes/typescript-ts-mode.el
b/lisp/progmodes/typescript-ts-mode.el
index c7b332c614..8a9d540bd3 100644
--- a/lisp/progmodes/typescript-ts-mode.el
+++ b/lisp/progmodes/typescript-ts-mode.el
@@ -289,11 +289,7 @@
:group 'typescript
:syntax-table typescript-ts-mode--syntax-table
- (cond
- ;; `typescript-ts-mode' requires tree-sitter to work, so we don't check if
- ;; user enables tree-sitter for it.
- ((treesit-ready-p 'tsx)
- ;; Tree-sitter.
+ (when (treesit-ready-p 'tsx)
(treesit-parser-create 'tsx)
;; Comments.
@@ -330,12 +326,8 @@
;; Which-func (use imenu).
(setq-local which-func-functions nil)
- (treesit-major-mode-setup))
+ (treesit-major-mode-setup)))
- ;; Elisp.
- (t
- (js-mode)
- (message "Tree-sitter for TypeScript isn't available, falling back to
`js-mode'"))))
(provide 'typescript-ts-mode)
- master updated (14d54212ea -> a3d8da2476), Yuan Fu, 2022/11/26
- master d884b43634 1/7: Partially fix some python tests (bug#59477), Yuan Fu, 2022/11/26
- master 447b9d48d9 3/7: Add treesit-font-lock-level, Yuan Fu, 2022/11/26
- master 3fe5fc3dc1 6/7: Make bash-ts-mode fall back to sh-mode if the file isn't in Bash, Yuan Fu, 2022/11/26
- master a3d8da2476 7/7: Make typescript-ts-mode not fallback to js-mode,
Yuan Fu <=
- master cc086f37e8 2/7: Add default limit for tree-sitter recursive tree-traversing function, Yuan Fu, 2022/11/26
- master bd10c3cfa2 5/7: Correctly fontify types in typeof() expression in csharp-ts-mode, Yuan Fu, 2022/11/26
- master 93c8220937 4/7: Reorganize treesit-font-lock-feaure-list's to the new level scheme, Yuan Fu, 2022/11/26