简体   繁体   English

缺少CSS类的Visual Studio 2015转到定义

[英]Visual Studio 2015 Go To Definition for CSS class missing

When I right-click on a css class in an html file in Visual Studio 2015 Enterprise edition, i don't see the option to "Go To Definition". 在Visual Studio 2015 Enterprise Edition中的html文件中的CSS类上单击鼠标右键时,看不到“转到定义”选项。 Nothing happens if I press F12 either. 如果我按F12键也没有任何反应。 Intellisense works, but I have no easy way of finding where the class referenced is actually defined. Intellisense可以工作,但是我没有简单的方法来找到所引用的类的实际定义位置。 I've restarted VS, and also looked at a colleague's setup that works fine and can't see a difference. 我重新启动了VS,还查看了同事的设置,该设置工作正常并且看不到任何区别。 I know it's not the end of the world, but any help much appreciated. 我知道这不是世界末日,但是任何帮助都值得赞赏。 Thanks. 谢谢。

There are a couple of solutions both 'Extensions and Updates' to Visual Studio: 有两种针对Visual Studio的“扩展和更新”解决方案:

  1. Web Essentials by Mads Kristensen at Microsoft. Microsoft的Mads Kristensen撰写的Web Essentials This provides F12 'go to definition' and Alt+F12 for 'peek definition'. 这提供了F12“转到定义”和Alt + F12“窥视定义”。
  2. Productivity Power Tools 2015 by Microsoft. Microsoft的生产力电动工具2015 Similar to the above providing Ctrl + Click to Peek Definition / Go To Definition. 与以上类似,提供Ctrl +单击以查看定义/转到定义。

My preference would be Web Essentials as I found one of the other power tools features 'Solution Error Visualizer' a bit buggy. 我更喜欢Web Essentials,因为我发现其中一个其他的电动工具功能“ Solution Error Visualizer”有点故障。

As to your colleague's set up hard to say. 至于你的同事的设置很难说。 Out of the box visual studio sometimes installs web essentials by default. 默认情况下,Visual Studio有时会开箱即用地安装Web Essentials。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM