Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Add TypeScript to supported file extensions? #357

Closed
mattmischuk opened this issue Apr 26, 2017 · 7 comments
Closed

Question: Add TypeScript to supported file extensions? #357

mattmischuk opened this issue Apr 26, 2017 · 7 comments

Comments

@mattmischuk
Copy link

I'm using language-babel for syntax highlighting for TypeScript. There isn't a good package that I've found to date. I usually just manually add the extension in the grammar file locally. But I was wondering if it would be worth while to just create a pull-request. This may conflict with other packages so I thought I would pose this as a question first. Thoughts?

@gandm
Copy link
Owner

gandm commented Apr 26, 2017

I'm a bit reluctant as this grammar isn't Typescript compatible. You could us the config.cson to force .ts files to use my grammar - https://discuss.atom.io/t/how-do-i-make-atom-recognize-a-file-with-extension-x-as-language-y/26539

I guess you've tried the https://github.com/TypeStrong/atom-typescript package? It syncs with Microsoft's vscode grammar so it should be up to date.

@mattmischuk
Copy link
Author

I have, the syntax highlighting is not as good. Also it adds a bunch of bloat and unnecessary features. I guess all I really want is a plain grammar and syntax package. Which your package works wonders for... I'll try out the config.cson solution for now. I might just fork this repo and make a dedicated language-typescript package.

@mattmischuk
Copy link
Author

Does this change anything?

babel/babylon#523 (comment)

@mattmischuk mattmischuk reopened this Jun 29, 2017
@gandm
Copy link
Owner

gandm commented Jun 30, 2017

@mattmischuk Not sure. It would mean augmenting the grammar to handle specific typescript features and whilst I imagine this wouldn't be a problem I may be wrong. A lot of elements that are common are scoped as flowtype and I don't want to change these nor do I want to add a new scope.

The parser seems interesting but I'm not sure who it's aimed at. I'd imagine most TypeScripters would still use tsc with Babel as a backend tool. I'd be interested to see what other TypeScript users think.

@gandm
Copy link
Owner

gandm commented Aug 15, 2017

I don't see much traction for this at the moment. The Atom team has ported the Microsoft typescript grammar recently and are also working on other initiatives that are better suited to a TypeScript workflow. See https://github.com/atom/language-typescript and https://atom.io/packages/ide-typescript

@gandm gandm closed this as completed Aug 15, 2017
@mattmischuk
Copy link
Author

Good call, thanks for reviewing this again :)

@trusktr
Copy link

trusktr commented Jun 13, 2018

I'm using TypeScript, but I want syntax highlighting inside of template strings. It'd be awesome to add TypeScript so that it can have this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants