Open a file in Visual Studio's CSS Source Editor

后端 未结 4 1816
小鲜肉
小鲜肉 2020-12-08 07:51

I am using Phil Haack\'s T4CSS T4 template based on .less

One bad thing about Phil\'s solution is that visual studio opens the .less files as plain text files rather

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-08 08:43

    I just posted an extension that does this; you can download it from the Visual Studio Gallery.

    The key to the extension is the .pkgdef file:

    [$RootKey$\Languages\File Extensions\.less]
    @="{A764E898-518D-11d2-9A89-00C04F79EFC3}"
    
    [$RootKey$\Editors\{A764E89A-518D-11d2-9A89-00C04F79EFC3}\Extensions]
    "less"=dword:00000028
    

    Note that this extension doesn't do anything to help the CSS language service support Less; nested rules, for example, don't work very well at all (it confuses the CSS language service).

提交回复
热议问题