Skip to content

Commit

Permalink
Add AutoImportSuggestions for UMD module export declarations instead …
Browse files Browse the repository at this point in the history
…of global keywords
  • Loading branch information
aminpaks committed Jan 20, 2021
1 parent 8dbc226 commit 6ee5516
Showing 1 changed file with 5 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,22 @@
//// { "dependencies": { "@types/classnames": "*" } }

// @filename: /tsconfig.json
//// {
//// "compilerOptions": {
//// "module": "esnext",
//// "target": "es2015",
//// "esModuleInterop": true,
//// "allowSyntheticDefaultImports": true
//// }
//// }
//// {}

// @filename: /node_modules/@types/classnames/package.json
//// { "name": "@types/classnames", "types": "index.d.ts" }

// @filename: /node_modules/@types/classnames/index.d.ts
//// declare const classNames = () => string;
//// declare const classNames: () => string;
//// export = classNames;
//// export as namespace classNames;

// @filename: /SomeReactComponent.tsx
//// import * as React from 'react';
////
//// const el = <div className={class/*0*/}>foo</div>;
//// const el = <div className={classNames/*1*/}>foo</div>;
//// const el1 = <div className={class/*1*/}>foo</div>;

goTo.marker("0");
goTo.marker("1");

verify.completions({
includes: [{
Expand All @@ -39,14 +32,3 @@ verify.completions({
includeCompletionsForModuleExports: true,
}
});

goTo.marker("1");

format.setOption("newLineCharacter", "\n");
verify.importFixAtPosition([
`import classNames from 'classnames';
import * as React from 'react';
const el = <div className={class}>foo</div>;
const el = <div className={classNames}>foo</div>;`
]);

0 comments on commit 6ee5516

Please sign in to comment.