You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CodeLens could be on-demand, instead of always showing all references to all items, the references view could be shown on mouse over instead, or at least have an option for mouse over. Now view feels very cluttered with it, but needs unnecessary steps if it's completely disabled.
Reacted by Adrian Stutz, Matt McNabb, Trevor Gau, Angelo Di Pilla, atlv, Kristian, Bart F, Shinichi TAMURA, tustin2121, Mike Simons and 30 more
I would appreciate this is as well. I like the functionality of the code lens but having the references always displayed clutters the code and it's also a bit distracting during editing when the lines move to make space for the reference count.
Reacted by Andy Sammalmaa, Qwerty (Vítězslav Ackermann Ferko), Drew and Lucas Ceratto
I'd like to add to this as well. Code lenses are great but sometimes feel a bit awkward when they interrupt the line height in the editor, particularly if the code has several lines in close proximity that instantiate a lens.
It would be nice if CodeLens supported a different method of representation. For instance, instead of adding code lenses above the referenced line of code, developers could opt to use a symbol in the margin which can be expanded on hover. Another way could be to use an inline marker similar to the problem squiggles - maybe leveraging a different color or shape to indicate that it's a lens?
Thanks!
Reacted by Ope, tustin2121, Andy Sammalmaa, kenj0418, Alexander Demukh and Drew
ANYTHING to make it so the stupid feature stops taking up more vertical space. An option to put it to the side, an option to hover it, an option to make it into a little indicator to the left that you hover over like the suggestion list, ANYTHING ELSE that makes it so it quits making my code suddenly jump to be twice as high than it needs to be! It might be a nice feature, but the fact that it jumps and makes the code bloated means I turn it off every time it appears!
It frustrates me most that there's already been a bunch of issues created about it, and they've all be closed and locked, because apparently the dev team only likes it when their most touted feature is in your face and they refuse to see how annoying it can be.
Reacted by Andy Sammalmaa, Sam J, Robert Lloyd, kenj0418, Drew and Dan Moore
Jetbrains' Rider has an option to push their code lens-like feature to the end of the line like so:
I would love this for Code as having the lines constantly jump up and down as I type is irritating.
Reacted by Benjamin Storrier, Giuliani Sanches, Qwerty (Vítězslav Ackermann Ferko), Johannes Rieken, Roland Kontson, Francisco Carvalho and kpietraszko
I would really like this as well. Most of the time CodeLens is a massive distraction when editing code. When you are concentrating hard on the code you are editing, having extraneous information jump out at you and having the lines of code move around is exasperating. It becomes an invasion of your mental space. Since it is impossible to ignore it a part of your thoughts necessarily go there and therefore away from the code.
Sometimes the information is useful, and it would be nice to have it available at the fingertips, so both display on hover and display at the end of the line would be good solutions. I would prefer on hover though so the code display is less cluttered most of the time.
As it is now, unfortunately, all I can do is turn it off. So that is what I do.
Was about to make the same request as Andy Sammalmaa (@Pondidum), to add them to end of line.
The new implementation of code lens in current version (which I understand is reverted in 1.42) messes code readability up bad with reference counts between properties of regular objects.
Edit: to address ackvf's point, I would like to see them.
I always thought that it has to be in the end of the line. I have to disable it because it get's in the way. Came here to suggest to show it on hover as well. Seems like such an obvious and must-have feature now.
Reacted by Roland Kontson, Qwerty (Vítězslav Ackermann Ferko) and NemoStein
My main concern is the visual distraction. Moving it to the end of the line would only reduce the waste of vertical space. I would definitely go for a pure mouseover with only a really subtle visual hint to indicate that there is some information available.
Is there any new info on this?
I am currently developing a language extension and most of the CodeLenses I use show contextual information that is not of interest all the time.
An option to only show CodeLenses at the current cursor position / line would be fantastic.
My current workaround would involve a custom LSP endpoint for executeCommand (https://microsoft.github.io/language-server-protocol/specifications/specification-3-16/#workspace_executeCommand) that receives the current cursor position, calculates CodeLenses for that position and returns them to only show these - quite inelegant, as moving the cursor triggers recalculation of CodeLenses. But this won't work as there is no way to manually trigger rendering of codelenses upon change of the cursor position.
Is there any possibility to access the currently displayed CodeLenses at all?
We closed this issue because we don't plan to address it in the foreseeable future. You can find more detailed information about our decision-making process here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.
For years, I have disabled Code Lens in both Visual Studio Community and Visual Studio Code because the inline display is visually distracting and creates too much noise in the editor. However, the information provided by Code Lens (references, implementations, etc.) is undeniably useful.
This is a widely shared concern. Throughout the years, I have discussed this with colleagues, and we all share the same experience: we avoid using this useful feature because of the visual clutter it generates.
Making Code Lens on-demand via Hover would be an excellent solution, as it preserves the utility while dramatically improving the editor's visual clarity.
I would also like to suggest considering the Status Bar as an additional option. Showing the Code Lens information there when the cursor is in the function/class could be another minimal-impact way to deliver this valuable context without cluttering the main code area.
⚙️ Important: Focus on Configurability
This does not have to be a mandatory change. The goal should be to make the display method configurable. Users who prefer Code Lens inline should be able to keep it that way, and those who want it on hover or in the status bar should have those options available.
Please reconsider marking this as out-of-scope, as there is significant user demand for a less intrusive way to access this feature.
Activity
[-]CodeLens on hover[/-][+]CodeLens on hover [feature-request] [editor][/+][-]CodeLens on hover [feature-request] [editor][/-][+]CodeLens on hover [feature-request] [editor] [ux][/+][-]CodeLens on hover [feature-request] [editor] [ux][/-][+]CodeLens on hover[/+]sttz commentedon Jun 8, 2017
I would appreciate this is as well. I like the functionality of the code lens but having the references always displayed clutters the code and it's also a bit distracting during editing when the lines move to make space for the reference count.
mattmcnabb commentedon Jun 27, 2017
I'd like to add to this as well. Code lenses are great but sometimes feel a bit awkward when they interrupt the line height in the editor, particularly if the code has several lines in close proximity that instantiate a lens.
It would be nice if CodeLens supported a different method of representation. For instance, instead of adding code lenses above the referenced line of code, developers could opt to use a symbol in the margin which can be expanded on hover. Another way could be to use an inline marker similar to the problem squiggles - maybe leveraging a different color or shape to indicate that it's a lens?
Thanks!
maltezefalkon commentedon Dec 5, 2017
+1
It's great information to have when you need it, but most of the time it's just in the way!
AurimasNav commentedon Feb 28, 2018
Came here looking for a way to disable "n references"
tustin2121 commentedon Dec 1, 2018
ANYTHING to make it so the stupid feature stops taking up more vertical space. An option to put it to the side, an option to hover it, an option to make it into a little indicator to the left that you hover over like the suggestion list, ANYTHING ELSE that makes it so it quits making my code suddenly jump to be twice as high than it needs to be! It might be a nice feature, but the fact that it jumps and makes the code bloated means I turn it off every time it appears!
It frustrates me most that there's already been a bunch of issues created about it, and they've all be closed and locked, because apparently the dev team only likes it when their most touted feature is in your face and they refuse to see how annoying it can be.
Pondidum commentedon Dec 6, 2018
Jetbrains' Rider has an option to push their code lens-like feature to the end of the line like so:
I would love this for Code as having the lines constantly jump up and down as I type is irritating.
aarsten commentedon Dec 26, 2018
I would really like this as well. Most of the time CodeLens is a massive distraction when editing code. When you are concentrating hard on the code you are editing, having extraneous information jump out at you and having the lines of code move around is exasperating. It becomes an invasion of your mental space. Since it is impossible to ignore it a part of your thoughts necessarily go there and therefore away from the code.
Sometimes the information is useful, and it would be nice to have it available at the fingertips, so both display on hover and display at the end of the line would be good solutions. I would prefer on hover though so the code display is less cluttered most of the time.
As it is now, unfortunately, all I can do is turn it off. So that is what I do.
1 remaining item
giulianisanches commentedon Jun 25, 2019
It would be greate to have it at the end of the lines and/or on hover, for sure.
Toggle will help for now :)
ackvf commentedon Oct 9, 2019
I would prefer if the position of cursor controlled when to display references.
entr0cks commentedon Dec 19, 2019
Was about to make the same request as Andy Sammalmaa (@Pondidum), to add them to end of line.
The new implementation of code lens in current version (which I understand is reverted in 1.42) messes code readability up bad with reference counts between properties of regular objects.
Edit: to address ackvf's point, I would like to see them.
vladislav-kostin commentedon Jan 7, 2020
I always thought that it has to be in the end of the line. I have to disable it because it get's in the way. Came here to suggest to show it on hover as well. Seems like such an obvious and must-have feature now.
NNemec commentedon Feb 24, 2020
My main concern is the visual distraction. Moving it to the end of the line would only reduce the waste of vertical space. I would definitely go for a pure mouseover with only a really subtle visual hint to indicate that there is some information available.
NemoStein commentedon Aug 2, 2020
Luuccc commentedon Oct 4, 2020
timmy-newtron commentedon Jul 27, 2021
Is there any new info on this?
I am currently developing a language extension and most of the CodeLenses I use show contextual information that is not of interest all the time.
An option to only show CodeLenses at the current cursor position / line would be fantastic.
My current workaround would involve a custom LSP endpoint for executeCommand (https://microsoft.github.io/language-server-protocol/specifications/specification-3-16/#workspace_executeCommand) that receives the current cursor position, calculates CodeLenses for that position and returns them to only show these - quite inelegant, as moving the cursor triggers recalculation of CodeLenses. But this won't work as there is no way to manually trigger rendering of codelenses upon change of the cursor position.
Is there any possibility to access the currently displayed CodeLenses at all?
vscode-triage-bot commentedon Oct 12, 2021
We closed this issue because we don't plan to address it in the foreseeable future. You can find more detailed information about our decision-making process here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.
If you wonder what we are up to, please see our roadmap and issue reporting guidelines.
Thanks for your understanding and happy coding!
lucerattow commentedon Dec 16, 2025
I strongly support this feature request.
For years, I have disabled Code Lens in both Visual Studio Community and Visual Studio Code because the inline display is visually distracting and creates too much noise in the editor. However, the information provided by Code Lens (references, implementations, etc.) is undeniably useful.
This is a widely shared concern. Throughout the years, I have discussed this with colleagues, and we all share the same experience: we avoid using this useful feature because of the visual clutter it generates.
Making Code Lens on-demand via Hover would be an excellent solution, as it preserves the utility while dramatically improving the editor's visual clarity.
I would also like to suggest considering the Status Bar as an additional option. Showing the Code Lens information there when the cursor is in the function/class could be another minimal-impact way to deliver this valuable context without cluttering the main code area.
⚙️ Important: Focus on Configurability
This does not have to be a mandatory change. The goal should be to make the display method configurable. Users who prefer Code Lens inline should be able to keep it that way, and those who want it on hover or in the status bar should have those options available.
Please reconsider marking this as
out-of-scope, as there is significant user demand for a less intrusive way to access this feature.