Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix auto imports in opening JSX tag (#44724)
- Loading branch information
1 parent
baff2f8
commit 2b421bf
Showing
2 changed files
with
43 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
// @jsx: react | ||
|
||
// @Filename: /types.d.ts | ||
//// declare namespace JSX { | ||
//// interface IntrinsicElements { a } | ||
//// } | ||
|
||
// @Filename: /Box.tsx | ||
//// export function Box(props: any) { return null; } | ||
|
||
// @Filename: /App.tsx | ||
//// export function App() { | ||
//// return ( | ||
//// <div className="App"> | ||
//// <Box/**/ | ||
//// </div> | ||
//// ) | ||
//// } | ||
|
||
verify.applyCodeActionFromCompletion("", { | ||
name: "Box", | ||
source: "/Box", | ||
description: `Import 'Box' from module "./Box"`, | ||
newFileContent: `import { Box } from "./Box"; | ||
export function App() { | ||
return ( | ||
<div className="App"> | ||
<Box | ||
</div> | ||
) | ||
}` | ||
}); |