Skip to content

fix the JS committee decisions, make import module syntax right #7793

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
zpdDG4gta8XKpMCd opened this issue Apr 3, 2016 · 3 comments
Closed
Labels
Duplicate An existing issue was already created

Comments

@zpdDG4gta8XKpMCd
Copy link

import * as ts form 'typescript' can't support autocompletion because the source comes after the imported identifiers. Let's do it the right way up: import from 'typescript' * as ts (just like Linq does) so we go naturally from a whole to a part, not the other way around

@zpdDG4gta8XKpMCd
Copy link
Author

syntax wise nothing changes the both ways can peacefully co-exist

@zpdDG4gta8XKpMCd
Copy link
Author

even import from from 'whatever'; is unambiguous:

  • current syntax: import the from identifier from 'whaterver'
  • proposed syntax: would fail because a string literal is expected coming after import from

so the 2 don't intersect

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Apr 4, 2016

I'll note that import from "typescript" * as ts is not really useful because you can name the import whatever the heck you want.

The real use would be when you're importing individual members of an import like import { A, B, C } from "the-alphabet". The usual proposal is from "typescript" import { SyntaxKind }.

We've gotten this request a good few times:

Believe me, I completely get it, but I don't think we could do this without the committee. I wouldn't be against us trying to work with the committee to get an alternate syntax in, but that's a separate problem in general.

@DanielRosenwasser DanielRosenwasser added the Duplicate An existing issue was already created label Apr 4, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
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