Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
dc73483
Parse type-only import specifiers
andrewbranch Sep 16, 2021
ad27364
Add type-only export specifiers
andrewbranch Sep 16, 2021
0ba00b9
Update transform and emit
andrewbranch Sep 16, 2021
eb63b02
Update checking
andrewbranch Sep 16, 2021
9b31bd1
Fix elision when combined with importsNotUsedAsValues=preserve
andrewbranch Sep 16, 2021
02d4ff9
Accept baselines
andrewbranch Sep 17, 2021
ac9b14b
Add test
andrewbranch Sep 20, 2021
577868d
WIP auto imports updates
andrewbranch Sep 20, 2021
c41f8ee
First auto-imports test working
andrewbranch Sep 20, 2021
d34544c
More auto-import tests
andrewbranch Sep 20, 2021
76da8c7
Fix auto imports of type-only exports
andrewbranch Sep 21, 2021
487f585
Add test for promoting type-only import
andrewbranch Sep 21, 2021
b6ea3ac
Sort import/export specifiers by type-onlyness
andrewbranch Sep 21, 2021
9a1765e
Update completions for `import { type |`
andrewbranch Sep 22, 2021
9e1878d
Update other completions tests
andrewbranch Sep 22, 2021
f7248e1
Respect organize imports sorting when promoting type-only to regular …
andrewbranch Sep 22, 2021
06063f2
Fix comment mistakes
andrewbranch Sep 24, 2021
4ba367b
Update src/services/codefixes/importFixes.ts
andrewbranch Sep 24, 2021
75a2909
Rearrange some order of assignments in parser
andrewbranch Sep 24, 2021
b55acde
Split huge if statement
andrewbranch Sep 24, 2021
414f38b
Remove redundant check
andrewbranch Sep 24, 2021
3768d0a
Merge branch 'main' into feature/type-only-specifiers
andrewbranch Sep 24, 2021
39e72d8
Update new transformer
andrewbranch Sep 24, 2021
9033c72
Fix import statement completions
andrewbranch Sep 24, 2021
adcb331
Fix type keyword completions good grief
andrewbranch Sep 27, 2021
d64c923
Fix last tests
andrewbranch Sep 27, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix comment mistakes
  • Loading branch information
andrewbranch committed Sep 24, 2021
commit 06063f20e596e5cef321c908b97cc6641211a408
4 changes: 2 additions & 2 deletions src/compiler/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7362,10 +7362,10 @@ namespace ts {
let isTypeOnly = false;
if (name.escapedText === "type") {
// If the first token of an import specifier is 'type', there are a lot of possibilities,
// especially we see 'as' afterwards:
// especially if we see 'as' afterwards:
//
// import { type } from "mod"; - isTypeOnly: false, name: type
// import { type as } from "mod"; - isTypeOnly: true, name: type
// import { type as } from "mod"; - isTypeOnly: true, name: as
// import { type as as } from "mod"; - isTypeOnly: false, name: as, propertyName: type
// import { type as as as } from "mod"; - isTypeOnly: true, name: as, propertyName: as
Comment thread
gabritto marked this conversation as resolved.
Comment on lines +7415 to +7418
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooof, this is awful.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have completion list tests for these?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tests for type and then completions working as usual after a type. After that, I don’t think you should get any completions, since the remaining things you type are / could be new identifier definitions... which I guess should still be tested ideally

if (token() === SyntaxKind.AsKeyword) {
Expand Down