Thom1729 / Sublime-JS-Custom

Customizable JavaScript syntax highlighting for Sublime Text.
MIT License
137 stars 9 forks source link

`toggle_comment` dosn't work for TypeScript #98

Closed predragnikolic closed 4 years ago

predragnikolic commented 4 years ago

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 |
Thom1729 commented 4 years ago

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.

predragnikolic commented 4 years ago

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.

Thom1729 commented 4 years ago

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.

predragnikolic commented 4 years ago

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

Thom1729 commented 4 years ago

Released in v2.4.1.