Add deno-tsx-ts-mode and automatically configure Eglot
Add changelog
Update docs and bump to 0.2.0
A major mode for Deno, based on typescript-ts-mode
.
typescript-ts-mode
)auto-mode-alist
resolution for ".ts" and ".tsx" filesRequires Emacs 29+ with tree-sitter installed.
Available on MELPA:
(use-package deno-ts-mode
:ensure t)
deno-ts-mode
depends on tree-sitter. You will probably want both the
typescript
and tsx
parsers installed:
(setq treesit-language-source-alist
'((typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src")
(tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src")))
(mapc #'treesit-install-language-grammar (mapcar #'car treesit-language-source-alist))
deno-ts-mode
will automatically configure auto-mode-alist
to check
for Deno projects when resolving the ".ts" and ".tsx" file
extensions. Whether or not a project is considered a Deno project is
based on the existence of a Deno configuration
file
at the project root. Both deno.json
and deno.jsonc
are considered
valid configuration files.
If a ".ts" or ".tsx" file is not in a project with a Deno
configuration file, deno-ts-mode-maybe
will fallback to either
typescript-ts-mode
or tsx-ts-mode
depending on the extension.
If your project's deno configuration file contains tasks you can run them directly from Emacs.
M-x deno-ts-run-task
(use-package deno-ts-mode
:ensure t)
(use-package eglot
:ensure t
:hook ((deno-ts-mode . eglot-ensure)
(deno-tsx-ts-mode . eglot-ensure)))
Please direct bug reports or patches to the mailing list.
Licensed under GPL-3.0.