-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JS Extras: Highlight import and export bindings (#2533)
- Loading branch information
1 parent
bcef22a
commit c51abab
Showing
4 changed files
with
304 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
151 changes: 151 additions & 0 deletions
151
tests/languages/javascript!+js-extras/exports_feature.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
export * from "mod"; | ||
export * as Foo from "mod"; | ||
export {} from "mod"; | ||
export {x} from "mod"; | ||
export {d} from "mod"; | ||
export {d,} from "mod"; | ||
export {d as Foo, b as Bar} from "mod"; | ||
export {d as Foo, b as Bar,} from "mod"; | ||
export {} | ||
export {x} | ||
export {d} | ||
export {d,} | ||
export {d as Foo, b as Bar} | ||
export {d as Foo, b as Bar,} | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["keyword", "export"], | ||
["exports", [ | ||
["operator", "*"] | ||
]], | ||
["keyword", "from"], | ||
["string", "\"mod\""], | ||
["punctuation", ";"], | ||
["keyword", "export"], | ||
["exports", [ | ||
["operator", "*"], | ||
["keyword", "as"], | ||
["maybe-class-name", "Foo"] | ||
]], | ||
["keyword", "from"], | ||
["string", "\"mod\""], | ||
["punctuation", ";"], | ||
["keyword", "export"], | ||
["exports", [ | ||
["punctuation", "{"], | ||
["punctuation", "}"] | ||
]], | ||
["keyword", "from"], | ||
["string", "\"mod\""], | ||
["punctuation", ";"], | ||
["keyword", "export"], | ||
["exports", [ | ||
["punctuation", "{"], | ||
"x", | ||
["punctuation", "}"] | ||
]], | ||
["keyword", "from"], | ||
["string", "\"mod\""], | ||
["punctuation", ";"], | ||
["keyword", "export"], | ||
["exports", [ | ||
["punctuation", "{"], | ||
"d", | ||
["punctuation", "}"] | ||
]], | ||
["keyword", "from"], | ||
["string", "\"mod\""], | ||
["punctuation", ";"], | ||
["keyword", "export"], | ||
["exports", [ | ||
["punctuation", "{"], | ||
"d", | ||
["punctuation", ","], | ||
["punctuation", "}"] | ||
]], | ||
["keyword", "from"], | ||
["string", "\"mod\""], | ||
["punctuation", ";"], | ||
["keyword", "export"], | ||
["exports", [ | ||
["punctuation", "{"], | ||
"d ", | ||
["keyword", "as"], | ||
["maybe-class-name", "Foo"], | ||
["punctuation", ","], | ||
" b ", | ||
["keyword", "as"], | ||
["maybe-class-name", "Bar"], | ||
["punctuation", "}"] | ||
]], | ||
["keyword", "from"], | ||
["string", "\"mod\""], | ||
["punctuation", ";"], | ||
["keyword", "export"], | ||
["exports", [ | ||
["punctuation", "{"], | ||
"d ", | ||
["keyword", "as"], | ||
["maybe-class-name", "Foo"], | ||
["punctuation", ","], | ||
" b ", | ||
["keyword", "as"], | ||
["maybe-class-name", "Bar"], | ||
["punctuation", ","], | ||
["punctuation", "}"] | ||
]], | ||
["keyword", "from"], | ||
["string", "\"mod\""], | ||
["punctuation", ";"], | ||
["keyword", "export"], | ||
["exports", [ | ||
["punctuation", "{"], | ||
["punctuation", "}"] | ||
]], | ||
["keyword", "export"], | ||
["exports", [ | ||
["punctuation", "{"], | ||
"x", | ||
["punctuation", "}"] | ||
]], | ||
["keyword", "export"], | ||
["exports", [ | ||
["punctuation", "{"], | ||
"d", | ||
["punctuation", "}"] | ||
]], | ||
["keyword", "export"], | ||
["exports", [ | ||
["punctuation", "{"], | ||
"d", | ||
["punctuation", ","], | ||
["punctuation", "}"] | ||
]], | ||
["keyword", "export"], | ||
["exports", [ | ||
["punctuation", "{"], | ||
"d ", | ||
["keyword", "as"], | ||
["maybe-class-name", "Foo"], | ||
["punctuation", ","], | ||
" b ", | ||
["keyword", "as"], | ||
["maybe-class-name", "Bar"], | ||
["punctuation", "}"] | ||
]], | ||
["keyword", "export"], | ||
["exports", [ | ||
["punctuation", "{"], | ||
"d ", | ||
["keyword", "as"], | ||
["maybe-class-name", "Foo"], | ||
["punctuation", ","], | ||
" b ", | ||
["keyword", "as"], | ||
["maybe-class-name", "Bar"], | ||
["punctuation", ","], | ||
["punctuation", "}"] | ||
]] | ||
] |
124 changes: 124 additions & 0 deletions
124
tests/languages/javascript!+js-extras/imports_feature.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
import React from 'react'; | ||
import x from "mod"; | ||
import * as Foo from "mod"; | ||
import {} from "mod"; | ||
import {d} from "mod"; | ||
import {d,} from "mod"; | ||
import {d as Foo, b as Bar} from "mod"; | ||
import {d as Foo, b as Bar,} from "mod"; | ||
import Foo, { Bar } from "mod"; | ||
import Foo, * as Bar from "mod"; | ||
|
||
import "mod"; | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["keyword", "import"], | ||
["imports", [ | ||
["maybe-class-name", "React"] | ||
]], | ||
["keyword", "from"], | ||
["string", "'react'"], | ||
["punctuation", ";"], | ||
["keyword", "import"], | ||
["imports", [ | ||
"x" | ||
]], | ||
["keyword", "from"], | ||
["string", "\"mod\""], | ||
["punctuation", ";"], | ||
["keyword", "import"], | ||
["imports", [ | ||
["operator", "*"], | ||
["keyword", "as"], | ||
["maybe-class-name", "Foo"] | ||
]], | ||
["keyword", "from"], | ||
["string", "\"mod\""], | ||
["punctuation", ";"], | ||
["keyword", "import"], | ||
["imports", [ | ||
["punctuation", "{"], | ||
["punctuation", "}"] | ||
]], | ||
["keyword", "from"], | ||
["string", "\"mod\""], | ||
["punctuation", ";"], | ||
["keyword", "import"], | ||
["imports", [ | ||
["punctuation", "{"], | ||
"d", | ||
["punctuation", "}"] | ||
]], | ||
["keyword", "from"], | ||
["string", "\"mod\""], | ||
["punctuation", ";"], | ||
["keyword", "import"], | ||
["imports", [ | ||
["punctuation", "{"], | ||
"d", | ||
["punctuation", ","], | ||
["punctuation", "}"] | ||
]], | ||
["keyword", "from"], | ||
["string", "\"mod\""], | ||
["punctuation", ";"], | ||
["keyword", "import"], | ||
["imports", [ | ||
["punctuation", "{"], | ||
"d ", | ||
["keyword", "as"], | ||
["maybe-class-name", "Foo"], | ||
["punctuation", ","], | ||
" b ", | ||
["keyword", "as"], | ||
["maybe-class-name", "Bar"], | ||
["punctuation", "}"] | ||
]], | ||
["keyword", "from"], | ||
["string", "\"mod\""], | ||
["punctuation", ";"], | ||
["keyword", "import"], | ||
["imports", [ | ||
["punctuation", "{"], | ||
"d ", | ||
["keyword", "as"], | ||
["maybe-class-name", "Foo"], | ||
["punctuation", ","], | ||
" b ", | ||
["keyword", "as"], | ||
["maybe-class-name", "Bar"], | ||
["punctuation", ","], | ||
["punctuation", "}"] | ||
]], | ||
["keyword", "from"], | ||
["string", "\"mod\""], | ||
["punctuation", ";"], | ||
["keyword", "import"], | ||
["imports", [ | ||
["maybe-class-name", "Foo"], | ||
["punctuation", ","], | ||
["punctuation", "{"], | ||
["maybe-class-name", "Bar"], | ||
["punctuation", "}"] | ||
]], | ||
["keyword", "from"], | ||
["string", "\"mod\""], | ||
["punctuation", ";"], | ||
["keyword", "import"], | ||
["imports", [ | ||
["maybe-class-name", "Foo"], | ||
["punctuation", ","], | ||
["operator", "*"], | ||
["keyword", "as"], | ||
["maybe-class-name", "Bar"] | ||
]], | ||
["keyword", "from"], | ||
["string", "\"mod\""], | ||
["punctuation", ";"], | ||
|
||
["keyword", "import"], | ||
["string", "\"mod\""], | ||
["punctuation", ";"] | ||
] |