智能感知与MVC4风格捆绑 [英] Intellisense with MVC4 Style Bundling

查看:115
本文介绍了智能感知与MVC4风格捆绑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,我无法找到一个问题或解决这一点。我敢肯定,这是一些简单的我失踪。

So far I can't find a question or fix for this. I'm sure it's something simple I'm missing.

我有一帮缩小的CSS的样式包,而我与装修中的类HTML元素。的一切是伟大的工作。

I have a style bundle with a bunch of minified CSS, and I am decorating HTML elements with the classes inside. Everything is working great.

智能感知和ReSharper的但都缠着我对CSS类是未知的。我猜这是因为他们不能束里面窥视。

Intellisense and ReSharper however are both bugging me about the CSS the classes being unknown. I'm guessing this is because they cannot peek inside the bundles.

问:有没有办法解决这个问题。

Question: Is there a way to fix this?

<!-- Style Bundles in HEAD tag-->
@Styles.Render("~/bundle/style/css")
@RenderSection("styles", false);

<!-- HTML elements in BODY tag: "row" is an unknown css class -->
<div class="row">
    <p>Lorem ipsum</p>
</div>

更新: 的Visual Studio 2012 LESS转换和智能工程单直接引用文件。我的情况是,引用LESS软件包时,智能感知休息。

更新2:这里显示了code中的 BundleConfig.cs ,因为它不是明确

Update 2: Here's the code showing the BundleConfig.cs since it isnt clear

var customStyles = new Bundle("~/bundle/style/css")
                      .Include("~/Content/normalize.css","~/Content/*.less");
bootstrapStyles.Transforms.Add(new LessTransform());
bootstrapStyles.Transforms.Add(new CssMinify());
bundles.Add(customStyles);

我们正在使用的通知捆绑不是 StyleBundle ,因为我们要指定LessTransform()类,这是必要的,跳过内置的CSS变压器。该LessTransform对象是一个自定义对象,简单地读取所有的内容较少和并置它放在一个StringBuilder,然后调用无点的转换......谈到了正在缩小的并返回一个巨大的CSS字符串。问题是,为什么不能VS或返回CSS和帮助检查类样式ReSharper的偷看?

Notice we are using Bundle not StyleBundle which is necessary because we want to specify the LessTransform() class and skip the built in CSS transformer. The LessTransform object is a custom object that simply reads in all the LESS content and concatenates it on a StringBuilder and then calls dotless's converter... out comes a huge CSS string that is minified and returned. The question is why cant VS or ReSharper peek at the returned CSS and help check class styles?

推荐答案

下面是关于JetBrains的博客中。这是一个有点过时,但朱拉继续记录指出,有对支持没有计划LESS(还)。

Here's a post on jetbrains blog. It's a bit out of date, but Jura went on record stating that there were no plans on supporting LESS (yet).

网友:

是否有支持不太什么计划吗?我不在乎了一大堆有关的全力支持,但它肯定是很好,如果它至少能带来突出和code完成支持到.LESS文件,并把它处理嵌套的规则。

Are there any plans to support LESS? I don’t care a whole lot about full support, but it would sure be nice if it could at least bring highlighting and code completion support into .less files and have it handle nested rules.

朱拉Gorohovsky:

Jura Gorohovsky :

没有,还没有这样的计划。你可以点我一个公开的
  使用那么广泛,使我们可以看看它的项目
  确定工作范围?

No, no such plans yet. Can you point me to a publicly available project that uses LESS extensively so that we can take a look at it to determine the scope of work?

链接

后期编辑:
从思维空间网络工作台可以提供一些什么人来此线程正在找。他们是bug修复非常响应,并已作出一些改进固体在较全球智能感知。

Late edit: Web WorkBench from Mindscape may provide what some people coming to this thread are looking for. They are very response to bug fixes, and have been making some solid improvements to intellisense in the LESS world.

这篇关于智能感知与MVC4风格捆绑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆