English 中文(简体)
Can I get Visual Studio to provide Intellisense and syntax coloring for Less Css?
原标题:

I am experimenting with Less Css, and I am using Visual Studio 2010.

It would be nice if the editor provided support for syntax highlighting and Intellisense for Less, for instance coloring and suggesting variables. What are my options to get that to work ? Do I need to write a plugin for it, or how would one go about adding this to VS ? Does anything exist for this already ?

最佳回答

If you are using Visual Studio 2012 you can use Web Essentials 2012. It uses syntax highlighting similar to Visual Studio s CSS syntax highlighter. It compiles to CSS on save.

enter image description here

Update

  • 2.4-2.5 Less syntax highlighting was disabled
  • As of 2.6 Less syntax highlighting was turned back on
  • As of 3.8 Less syntax highlighting is disabled for VS2012.

问题回答

http://www.mindscapehq.com/products/web-workbench

Update (07 Mar 2012)

After a week or so of using this, I have uninstalled it due to:

  1. Annoying nagging adverts telling you to upgrade
  2. A weird bug that stopped me being able to save my .less files intermittently

This extension seems better : LessExtension

Here is the author description :

  • Autocompile on save (using dotless)
  • Highlight matching braces
  • Syntax highlight (No multiline comment support)
  • Word highlight when a word occurs multiple times
  • Word completion using Visual Studios css 2.1 definition
  • Outlining so { ... } sections can be collapsed

And it work nice for me.

I can t find one on the Visual Studio Gallery (as of 5/2/10) besides CSS Is Less, which only hooks up the built-in CSS language service.

If you want to learn how to write one yourself, you can start by looking at the Ook Language Integration sample. Implementing the extension points in that sample (classification, quick info source, completion source) will give you the features you asked for (syntax highlighting, hover tips, intellisense completion).





相关问题
Intellisense not showing anything I write

I am using Visual C# 2008 express. I m also running Windows 7. I created a simple form, but Intellisense doesn t show anything I wrote. I write: private RadioButton rbtn_sortLocation; And then when ...

Intellisense not working

Intellisense is not working correctly for new user Controls. Any class in the same namespace as my new class is not visible in intellisense. It compiles without any problem. I m using VS 2008.

Shortlisting Intellisense

Does anyone know if there s a way in VS 2008 to shortlist the Intellisense to show only, say, events or properties? Or is there possibly a plug-in for this? I use Intellisense over going to the ...

Intellisense for C# User Control in VB.NET project

I have created a C# user control which I want to use in VB.NET .. the control works fine, but in VB.NET the Intellisense does not show any of the C# user control function descriptions (in summary xml ...

visual studio intellisense error

template <typename T> class Test { friend Test<T> & operator * (T lhs, const Test<T> & rhs) { Test<T> r(rhs); // return r *= lhs; ...

Jquery and Intellisense in VS 2008 with hotfix and SP1

I followed Scott Guthrie s instructions as outlined at http://weblogs.asp.net/scottgu/archive/2008/11/21/jquery-intellisense-in-vs-2008.aspx but no avail: intellisense still doesn t work. Any tips?

热门标签