emacs-devel
[Top][All Lists]
Advanced

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

Re: TypeScript support for tree-sitter (was Re: Call for volunteers: add


From: Theodor Thornhill
Subject: Re: TypeScript support for tree-sitter (was Re: Call for volunteers: add tree-sitter support to major modes)
Date: Tue, 11 Oct 2022 10:42:12 +0200

Po Lu <luangruo@yahoo.com> writes:

> Yuan Fu <casouri@gmail.com> writes:
>
>> +(add-to-list 'auto-mode-alist '("\\.ts\\'" . typescript-mode))
>> +
>> +;;;###autoload
>> +(add-to-list 'auto-mode-alist '("\\.tsx\\'" . typescript-mode))
>> +
>> +(define-derived-mode typescript-mode prog-mode "TypeScript"
>> +  "Major mode for editing typescript."
>> +  :group 'typescript
>> +  :syntax-table typescript-mode--syntax-table
>> +
>> +  (unless (or (treesit-can-enable-p)
>> +              (treesit-language-available-p 'tsx))
>> +    (error "Tree sitter for TypeScript isn't available."))
>
> So editing TypeScript source code will cause an error to be signalled
> when tree-sitter is not available?

No not anymore.  I've changed the implementation (Yet to be sent as a
patch) to default to using js-mode, as discussed in some other mail
around here

Thanks,
Theo



reply via email to

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