在Visual Studio中,SCSS文件未在“解决方案资源管理器”中分组显示

3

我正在使用Visual Studio 2013。

在解决方案资源管理器中,scss文件通常会将其.css、.css.map和.min.css文件分组显示在.scss文件下的树形结构中。但是,我的解决方案资源管理器正在单独显示它们,这导致了一些混乱。

有人能帮我并告诉我一个快捷键/技巧来重新将这些文件组合起来吗?

1个回答

4

您可以手动编辑项目文件,也可以使用这个非常方便的 Visual Studio 扩展:

enter image description here

手动操作方法是编辑项目文件,并向您想要显示为嵌套的每个文件添加 DependentUpon 元数据:

<ItemGroup>

    <!-- This will cause Visual Studio to show the file under Foo.1.cs -->
    <Compile Include="Foo.1.1.cs">
      <DependentUpon>Foo.1.cs</DependentUpon>
    </Compile>

    <!-- This will cause Visual Studio to show the file under Foo.cs -->
    <Compile Include="Foo.1.cs">
      <DependentUpon>Foo.cs</DependentUpon>
    </Compile>
    <Compile Include="Foo.cs" />
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>

来源:


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接