import Foo from 'bar' doesn't autocomplete

Have the following code in `index.js`.

Have a basic React Component in `App.js`.

import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';

ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();

Attempting to autocomplete on the import line:

Does not auto complete at all. (Visual Code for example finds it fine).

Any ideas?

 

 

0
3 comments

it is a default import from unknown file (i.e. you haven't yet entered a 'from' part). so, it's not clear what should be completed - a file name?

0

Just expecting Webstorm to auto scan default exports from the `App` module which resides in the project src folder. Visual Studio Code does it, just wondering why Webstorm doesn't. Is this the expected behaviour in Webstorm or am I missing a plugin/not configured my project fully?

0

>Just expecting Webstorm to auto scan default exports from the `App` module

Why should it be the 'App' module? And what scanning is expected? There can only be one default export per module, and the name you use when importing default module is an arbitrary name not necessary matching the existing file/module name. So I don't understand what completion is expected here

 

and yes, this is the expected behavior, and I'm not aware of any plugins supporting such 'completion'

-1

Please sign in to leave a comment.