Skip to content

Suggestion: from ... import #5821

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

Closed
louy opened this issue Nov 29, 2015 · 2 comments
Closed

Suggestion: from ... import #5821

louy opened this issue Nov 29, 2015 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@louy
Copy link

louy commented Nov 29, 2015

So one of the tiny silliest things when writing in typescript is that completion for import statements.
The ES6 spec suggests that import statements should look like this:

import someFunc from './someFunc';

That spec was apparently designed to be an alternative to var someFunc = require('./someFunc');. They clearly didn't have autocompletion in mind, which is one of the best features in TS.

My suggestion is introducing a new syntax to import files in Typescript that better suites the purposes of the language.

from './someFunc' import someFunc;

And the same thing should apply to "export from" statements.

from './someFile' export *;

In fact this issue is so annoying it got mentioned in this year's //build/ conf.

@DanielRosenwasser
Copy link
Member

We understand it can be a pain, and we've gotten this request a few times now:

As I replied elsewhere:

While the import syntax doesn't lend well to intellisense/completion, I don't think it would be appropriate to deviate from ES6.

As @danquirk suggests in #2371 (comment), our IDE experience should compensate for this problem using something like snippets.

@DanielRosenwasser DanielRosenwasser added the Duplicate An existing issue was already created label Nov 29, 2015
@louy
Copy link
Author

louy commented Nov 29, 2015

I'm sorry I haven't seen those earlier. Reading your comments there I think I get why it's the case. We should probably request this in ES7 or something.
Cheers!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants