combobulate icon indicating copy to clipboard operation
combobulate copied to clipboard

tsx or javascript?

Open DamienCassou opened this issue 3 years ago • 1 comments

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?

DamienCassou avatar Apr 23 '22 05:04 DamienCassou

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

mickeynp avatar Apr 23 '22 08:04 mickeynp

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.

sandinmyjoints avatar Feb 16 '23 14:02 sandinmyjoints

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.

mickeynp avatar Feb 17 '23 15:02 mickeynp

OK, I tried this:

  • pull latest combobulate (6c36a85f2ac5c8664106cddc80c3f115ff9d0c3e) and eval
  • visit Javascript file
  • switch to typescript-ts-mode
  • turn on combobulate-mode

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

sandinmyjoints avatar Mar 13 '23 13:03 sandinmyjoints