-
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.
Browse files
Browse the repository at this point in the history
Component commits: 5545946 Fix auto imports in opening JSX tag Co-authored-by: Andrew Branch <andrew@wheream.io>
- Loading branch information
1 parent
3221035
commit 7b61fa2
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> | ||
) | ||
}` | ||
}); |