TypeScript/tests/cases/fourslash/importNameCodeFix_jsExtension.ts
Andy b94061c587
getEditsForFileRename: Avoid changing import specifier ending (#26177)
* getEditsForFileRename: Avoid changing import specifier ending

* Support .json and .jsx extensions

* Restore typeRoots tests

* Fix json test

* When --jsx preserve is set, import ".tsx" file with ".jsx" extension

* Support ending preference in UserPreferences
2018-08-28 13:03:24 -07:00

34 lines
842 B
TypeScript

/// <reference path="fourslash.ts" />
// @moduleResolution: node
// @noLib: true
// @jsx: preserve
// @Filename: /a.ts
////export function a() {}
// @Filename: /b.ts
////export function b() {}
// @Filename: /c.tsx
////export function c() {}
// @Filename: /c.ts
////import * as g from "global"; // Global imports skipped
////import { a } from "./a.js";
////import { a as a2 } from "./a"; // Ignored, only the first relative import is considered
////b; c;
goTo.file("/c.ts");
verify.codeFixAll({
fixId: "fixMissingImport",
fixAllDescription: "Add all missing imports",
newFileContent:
`import * as g from "global"; // Global imports skipped
import { a } from "./a.js";
import { a as a2 } from "./a"; // Ignored, only the first relative import is considered
import { b } from "./b.js";
import { c } from "./c.jsx";
b; c;`,
});