reddit / emacs

What's your opinion about "TypeScript development with Emacs, tree-sitter and LSP in 2022"?

rakotomandimby · 2022-11-30 03:25
MitchellMarquez42 · 2022-11-30 06:07
Site looks clean, good theming and fonts. Don't see any inaccurate information, but then again I'm not really familiar with the TypeScript ecosystem. In fact, my biggest complaint is that the author refers to `r/emacs` as `/r/emacs`. That leading / is very annoying to me. That's my opinion.
x64_Toaster · 2022-11-30 07:12
I used to use a very similar setup for React development, and it works well in my experience. Interestingly, a lot of what is covered in this post should be possible out of the box with Emacs 29: [https://www.reddit.com/r/emacs/comments/z7upya/emacs\_29\_is\_nigh\_what\_can\_we\_expect/](https://www.reddit.com/r/emacs/comments/z7upya/emacs_29_is_nigh_what_can_we_expect/) I just upgraded to Emacs 29 and have done some TypeScript development with only the built-in `eglot` and `typescript-mode`, and it's solid so far! ~~The main issue I have is syntax highlighting for JSX doesn't work. I~~ *~~think~~* ~~this has to do with typescript-ts-mode not supporting TSX files yet.~~ Aside from the debugger, Emacs has essentially caught up to VS Code for my web development use cases. EDIT: removed incorrect statement that `tsi.el` has to do with syntax highlighting EDIT 2: syntax highlighting does work! I just needed to build the tree sitter languages and put them in a place Emacs could find them (there is one for TSX). See: https://git.savannah.gnu.org/cgit/emacs.git/tree/admin/notes/tree-sitter/starter-guide
KseandI · 2022-11-30 07:42
It's cool, I guess.
RemcoProgrammer · 2022-11-30 12:34
How does it compare with Tide? https://github.com/ananthakumaran/tide I started using that a few years ago and never felt a need for anything more, but I'm wondering what the differences are.
RadonedWasEaten · 2022-11-30 13:08
Ineffective
jplindstrom · 2022-11-30 14:54
I'm generally happy with `tide-mode` and `typescript-mode` for Typescript, but I have `lsp-mode` set up for other languages like Python, Terraform, YAML, etc. and that also works well. These are true quality-of-life improvements. I guess I'm tree-sitter curious, but it doesn't feel like it's an *essential* upgrade. BTW, if you're editing YAML files on the regular, you actually *need* the lsp server for that :) I was super surprised to see that for some specific YAML files like `serverless.yml` and `.gitlab-ci.yml` it was validating the structure from a schema. I think it uses the same for completion too. Very cool.
sammymammy2 · 2022-11-30 17:03
The leading / is pretty standard.
orzechod · 2022-11-30 17:31
hello, tsi.el creator here :) did you mean to say "indentation for JSX" rather than "syntax highlighting for JSX"? tsi.el is a package for indentation, not syntax-highlighting (for which everyone should be using `tree-sitter-hl-mode` until emacs 29 is released).
peatfreak · 2022-11-30 18:36
I'm interested in this, in particular setting up my Emacs for JS development but using plain JS rather than TypeScript.
MitchellMarquez42 · 2022-11-30 18:47
So is the color orange. Which I don't like either.
x64_Toaster · 2022-11-30 20:27
Thanks for the correction (and great work on the packages!) I edited the comment to clarify syntax highlighting isn't related to `tsi.el`.
TheFrenchPoulp · 2022-11-30 22:18
Also interested in the differences, with your setup where does the in-buffer completion frontend come from? Does flymake handle annotations too? Where does the server run? I confess that I've never taken the time to find out for myself