9

I'm following a certain thread suggesting a certain approach. As the image below shows, one can't disable the feature Show References for all languages.

When I discovered that, I tried to do that for C# alone (since that's the only language I code in where the listed references' count is an annoyance). However, as far I can see, there's nothing about CodeLens under C# specifically.

Do I need to turn off the whole CodeLens thingy or is there a way to disable aforementioned option only?

enter image description here

Community
  • 1
  • 1
Konrad Viltersten
  • 36,151
  • 76
  • 250
  • 438
  • @Dennis_E Please read the contents of the question before marking it as *possible duplicate* Such a mark makes other users prone to comply and vote a perfectly valid question as duplicate making it harder for other to fins and utilize. Just because a search for the title yield returns, it doesn't mean it's a duplicate. Chasing useful flags shouldn't be a purpose itself. – Konrad Viltersten Jun 23 '14 at 11:59
  • I didn't search for it; it appeared on the right under 'related'. I apologize if I misinterpreted the question. Your last line is: "Do I need to turn off the whole CodeLens thingy or is there a way to disable aforementioned option only?" I interpreted this as: "How do I disable the show references option only?" But looking at the title, you may have meant "How do I disable codelens for C# only?" (You did mention disabling the show references option in your question, hence the confusion) – Dennis_E Jun 23 '14 at 12:14
  • 2
    @Dennis_E It's quite all right. I understand your intention and it's all good but please keep in mind that **if** it'd be as easy to deem a question as dupe as listing the related articles, it'd be done automatically. I've seen a lot of quite good and original questions being closed because of **alleged duplication** and that's not the point of the function. To make it even more complicated, let's keep in mind that some questions need to be re-asked as new versions of the software are delivered. Having said that - it's always appreciated when people engage in improvements. :) – Konrad Viltersten Jun 23 '14 at 14:44
  • This is clearly not a duplicate – niico Dec 03 '16 at 12:15
  • @niico I know. Perhaps you could consider voting on reopen and, also, mentioning it on meta? – Konrad Viltersten Dec 03 '16 at 17:29
  • Looking at the bigger picture I don't think you can do what you want to do so - perhaps it's best to just move on with our lives rather than correcting this wrong? ;) – niico Dec 03 '16 at 18:07
  • When it comes to VS, it's not possible and probably won't be ever. Sadly. However, I feel that for the sake of SO, we should be firm with the yahoos who see **anything** linked and will should in panice "*dupe, dupe!*". Once I linked to **my own** question stating that *it's **not** a dupe of it* and still there was some moron who marked it as a dupe. (As for moving on, I do agree entirely. My last contribution on this subject was over two years ago, hehe.) – Konrad Viltersten Dec 03 '16 at 18:29

1 Answers1

8

Show References does a lot of heavy lifting for all the other lenses. It constructs the call tree that's used to compute the Tested By/Tests relation as well as the reference count and the Test Status. As such it cannot be disabled without turning off the other options.

There is currently no way to disable CodeLens on a per-language basis. Currently CodeLens only supports VB.NET and C# and it's an all-or-nothing thing, since it depends on Roslyn under the hood no other languages are currently supported.

Apart from doing that heavy lifting, the Reference Indicator is also put in place as a placeholder to prevent the editor from "stuttering" while the other lenses are loading. In an early beta it worked that way and that was incredibly annoying. There has been a version where they showed just empty space, and that was quickly replaced by always showing the reference indicator. Both because it should always be available and also because it's quick to compute and available offline.

I suggest you file a specific request for the changes you want to see on the Visual Studio User Voice. I believe now is the perfect time to send Microsoft feedback on this topic, they're in between releases.

jessehouwing
  • 106,458
  • 22
  • 256
  • 341