WebStorm不建议未导入的类

时间:2018-09-09 10:38:46

标签: javascript reactjs autocomplete webstorm

我是React和WebStorm的新手,所以也许我期望太高了,但是请考虑以下代码片段。我必须手动手动输入每import行。

如果您查看摘要,您将看到我的假想光标在哪里。我本来可以输入“ Lis ”或“ ”并按Ctrl-Space,WebStorm会建议List中的@material-ui/core/List 。但却什么也没做我最终不得不手动输入import语句,然后它才会自动完成。

它建议的唯一尚未导入的类是我的项目中定义的类。

import React from 'react';
import {withStyles} from '@material-ui/core/styles'
import Grid from '@material-ui/core/Grid';
import Card from '@material-ui/core/Card';
import Typography from '@material-ui/core/Typography';

// ...

export default withStyles(styles)(class StudentsPage extends React.Component {
        render() {
            const { classes } = this.props;

            return (
                <Grid container spacing={16} className={classes.root}>
                    <Grid item xs={6}>
                        <Card>
                            <Typography
                                variant={"display1"}>
                                Students
                            </Typography>
                            | // <--- cursor is here
                        </Card>
                    </Grid>
                    <Grid item xs={6}>
                        <Card>
                            Info
                        </Card>
                    </Grid>
                </Grid>
            );
        }
    }
)

如何让WebStorm为我的nodule_modules目录中的内容提供建议?

据我所知,我的设置是健康的。我正在使用WebStorm 2018.2。

screenshot of settings dialog

0 个答案:

没有答案