-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Insert auto imports after header comment (#39924)
* place first import after header * don't insert before non-header
- Loading branch information
1 parent
fca9f45
commit 91a7c35
Showing
4 changed files
with
64 additions
and
3 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
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
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,26 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
// @Filename: /a.ts | ||
////export const foo = 0; | ||
|
||
// @Filename: /b.ts | ||
////export const bar = 0; | ||
|
||
// @Filename: /c.ts | ||
/////*-------------------- | ||
//// * Copyright Header | ||
//// *--------------------*/ | ||
//// | ||
////import { bar } from "./b"; | ||
////foo; | ||
|
||
goTo.file("/c.ts"); | ||
verify.importFixAtPosition([ | ||
`/*-------------------- | ||
* Copyright Header | ||
*--------------------*/ | ||
import { foo } from "./a"; | ||
import { bar } from "./b"; | ||
foo;`, | ||
]); |
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,32 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
// @Filename: /a.ts | ||
////export const foo = 0; | ||
|
||
// @Filename: /b.ts | ||
////export const bar = 0; | ||
|
||
// @Filename: /c.ts | ||
/////*-------------------- | ||
//// * Copyright Header | ||
//// *--------------------*/ | ||
//// | ||
////const afterHeader = 1; | ||
//// | ||
////// non-header comment | ||
////import { bar } from "./b"; | ||
////foo; | ||
|
||
goTo.file("/c.ts"); | ||
verify.importFixAtPosition([ | ||
`/*-------------------- | ||
* Copyright Header | ||
*--------------------*/ | ||
const afterHeader = 1; | ||
import { foo } from "./a"; | ||
// non-header comment | ||
import { bar } from "./b"; | ||
foo;`, | ||
]); |