mickeynp / combobulate

Structured Editing and Navigation in Emacs with Tree-Sitter
GNU General Public License v3.0
945 stars 54 forks source link

tsx or javascript? #6

Closed DamienCassou closed 1 year ago

DamienCassou commented 2 years ago

Hi,

I'm new to the tree-sitter world and I just saw this line in combobulate.el:

(add-to-list 'tree-sitter-major-mode-language-alist '(js2-mode . tsx))

Why using "tsx" as language instead of plain Javascript?

In a plain old JavaScript buffer, should I still use combobulate-setup-js-ts?

mickeynp commented 2 years ago

Hey Damien. Yeah that's a good catch. I need to split out support for tsx/jsx so they're totally separate.

sandinmyjoints commented 1 year ago

Is it possible to distinguish between TS vs TSX, and JS vs JSX? After following combobulate's current setup, if I then open a Typescript file, not containing any TSX, the major mode is TypeScript[TSX]. It's not a huge problem, but not quite ideal either.

mickeynp commented 1 year ago

Yes, can you try the latest master branch? It should fix some teething issues around that.

Note that Combobulate looks at your tree sitter language to determine how to set itself up. So you can type M-x combobulate-mode in a buffer that has a javascript/typescript buffer and everything should work fine.

sandinmyjoints commented 1 year ago

OK, I tried this:

I get setq: Symbol's value as variable is void: combobulate-rules-typescript.