Champion: Bradley Farias (@bmeck)
Stage: 0
Code completion is painful for the current order of import
and from
.
This proposal seeks to add the inverse to make code completion work.
from "foo" import {bar};
import /*code completion here*/
Could be a string for the module specier, or the list of imported binding.
import "foo"/*code completion/programmer moves caret here after typing*/
// ^ code completion caret needs to be here for binding names
from /*code completion here*/
Module specifiers are the only thing that could be here to allow better code completion.
import "a";
Just for posterity we can add the from
prefixed form, even though it is more verbose:
from "a" import;
The position of module attributes would still be at the end.
from "./foo.json" import foo with type="json"
[no LineTerminator here]
rules in this form of import.// allowed currently
import
* as foo
from
'foo';
Due to from
needing to be a contextual keyword it needs to avoid problems with ASI and would have a grammar like:
from [no LineTerminator here] ModuleSpecifier import ImportClause?