TypeScript/tests/cases/fourslash/codeFixInferFromUsageContextualImport4.ts
Andrew Branch 03c79d7422
Insert auto-imports in sorted order (#39394)
* Sort auto-imports

* Avoid re-checking sort all the time

* Add comment
2020-07-08 15:25:04 -07:00

35 lines
768 B
TypeScript

/// <reference path="fourslash.ts" />
// @strict: true
// @noImplicitAny: true
// @noLib: true
// @Filename: /getEmail.ts
////import { User, Settings } from './a';
////export declare function getEmail(user: User, settings: Settings): string;
// @Filename: /a.ts
////export interface User {}
////export interface Settings {}
// @Filename: /b.ts
////import { getEmail } from './getEmail';
////
////export function f([|user|], settings) {
//// getEmail(user, settings);
////}
goTo.file("/b.ts");
verify.codeFix({
index: 0,
description: "Infer parameter types from usage",
newFileContent:
`import { User, Settings } from './a';
import { getEmail } from './getEmail';
export function f(user: User, settings: Settings) {
getEmail(user, settings);
}`
});