-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Suggestion: reversed syntax for importing symbols from a module #3127
Comments
I would love to have this! (I don't care if its break ES6 module syntax) |
Yes! Had the same thought during @ahejlsberg 's Build talk. It's practically the same rationale than for the reversed LINQ syntax in C#. |
I think everyone would love that! I'm sure even the TS team (i think Anders even pointed it out during the build talk), but the design goals of TS is to follow the ES specs as much as possible (it makes everything so much easier for them -- and us) [Spec-Goal-6]. If it wasn't for that rule, im sure 100s of things would be different, but it's that goal (and others) that makes it oh so very awesome! One thing that could be suggested is that we could type it as from "whatever" import {Something}; and it get generated as import {Something} from "whatever" ; but at the same time also support the ES6 spec of typing Another suggestion could be to create a VS snippet for typescript so that when you type import {} from "$c" ; then another tab would take you within the {} .... maybe? |
@AbubakerB that would be a very good solution to this problem. I think those who sit in TC39 should have thought about this problem. 😠 Because we have to live with this the rest of our lives now. |
@tinganho yea, but I'm sure they had their reasons though (or maybe they just did it for the laughs!) |
Good point about ES compatibility... Indeed, it would be a limited but for part of the audience still awesome thing to at least add better support in tooling to make the experience like it would be with the reversed syntax. And if this could be built directly into the TS compiler maybe this tooling support could be accessible for other editor plugins easily? |
Much as it would be nice to have |
Also see: |
So instead of having to type:
and then go back to fill in the {} with IntelliSense, a LINQ-like syntax would be easier to use like this:
The text was updated successfully, but these errors were encountered: