Thom1729/Sublime-JS-Custom

`toggle_comment` dosn't work for TypeScript

predragnikolic opened this issue · 5 comments

Hello,

The toggle comment command doesn't work when inside typescript files.

let x: number = 21 |

running the toggle command I expect to see:

// let x: number = 21 |

but I get:

let x: number = 21 |

I think I know what's going on. Are you using "scope": "source.ts"?

The built-in Toggle Comment command looks for a .tmPreferences file to figure out how comments work for the current syntax. The core JavaScript package provides one that matches source.js. JS Custom provides another one that matches source.js meta.jsx. But if the scope is source.ts, then Sublime doesn't know what to do.

A similar issue exists for jsx_close_tag.

Just to be absolutely sure, can you try removing the custom scope and see if comments work? If that's the only issue, then I have a fix in mind.

Are you using "scope": "source.ts"?

Yes, that is exactly what my custom scope is.

can you try removing the custom scope and see if comments work?

And yes,
removing the custom scope make the comment toggle command work.

Try v2.4.1-beta.2 and let me know if it works for you. In the long run, I'll want to make this more customizable, but I'm hoping that this will work in the meantime.

Sorry for not responding quickly.
Just tried it and it works as expected. Thanks for your time 👍

Released in v2.4.1.