top level element is not completed

今天在使用IDEA配置springmvc文件时,出现类似在Android studio 中样式文件报top level element is not completed错,郁闷极了,找了好久 才找到解决方案,问题解决了  然而并没有理解为什么 ,希望有大神可以帮回复。问题类似如下:

<resources>
    <!-- Base application theme. -->
    <style name="AppTheme" parent=""Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
    </style>
</resources>

在上面代码中“Theme.AppCompat.Light.DarkActionBar”会出现红线的下划线,用鼠标移动到右边红色错误标记处,会有“top level element is not completed。。。。”字样的错误提示。 
选择中出现红色下划线的“Theme.AppCompat.Light.DarkActionBar”部分(不包括双引号); 
再按Alt+Enter键; 
然后依次选择Un-inject Language/Reference即可
这里写图片描述
如上图所示,因为我的问题解决了,所以按Alt+Enter键后,有两个选项没出现,若没解决会出现4个选择,Un-inject Language是第4个选择。

原文地址:https://www.cnblogs.com/hoobey/p/6938296.html