-
Notifications
You must be signed in to change notification settings - Fork 512
Disable "n reference(s)" display for functions #924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Not currently, but I'll add a setting for it. |
@Bill-Stewart If you want to turn off all code lens support in PowerShell scripts, then you can do that now with your user settings. Press Ctrl+, and add this to the end e.g.:
|
Thanks Keith! Didn't know there was a switch at the editor level :) |
Thanks @rkeithhill - I don't want to disable all of code lens - just the references thing on functions that takes up vertical screen real-estate and creates a strange editing experience (weird line height on function lines). |
Thanks @daviwil - If we can turn off that display, that would be great! |
So does that mean you want the
Do you mean for PowerShell or for all languages? If you meant "all languages" then the setting I showed above disables code lens just for PowerShell scripts. Then again, if you use say GitLens then you wouldn't get the Git commit info code lens. Of course, if you have any code lens enabled it will occupy the same amount of vertical space. |
I meant just the part that says "n reference(s)" under the function name. It creates distracting screen jumping when cursoring past them up or down, particularly in RDP (and I use vscode in RDP quite a bit). |
If you use the setting that Keith gave you, those things will disappear. Keith was referring to another set of those items that show up over Pester tests, but you probably wouldn't want to see those either since they would take up the same screen real estate. I'd say using Keith's setting would be the most expedient approach to disable them right now until we can add one to the extension. |
Sure, that workaround is fine for now. Thanks! |
See this feature request for VSCode I love CodeLens, but I wish that it offered a different way to display the markers - it does feel a bit clumsy sometimes when these things interrupt your code's visual flow. |
I was searching for this issue, since I too find them insanely distracting. So is the work around still
|
It should be. If you're experiencing trouble, please let us know. |
Can you add the option "powershell.referencesCodeLens.enabled": true so only references are disabled? |
Yes, that is something that can be added - and based on the history that seems to be what this issue is tracking. I can't say that it's the highest priority issue right now though but it's something we should add. |
Sounds reasonable to me but I'd prefer a setting name like |
This class of issues regarding how code lens tampers with the presentation and layout of the user's document has been going on for years, even preceding the existence of VSCode. For example:
There is a (relatively) recent issue posted in the VSCode repo: microsoft/vscode#90235 , which has links back to other tickets where this persistently recurring topic has been discussed, going as far back as 2017. (If not earlier, but that is as far back as I've found so far.) I find this feature to be unbelievably irritating, in spite of its inherent usefulness. I have just "switched it off" completely for years. But I just recently started working on a box where I haven't worked before, and after I installed the C# extension, the "code-lens references" issue popped up again, and has been plaguing me for days. Now I'm seeing it in PowerShell. I must have disabled it completely years ago on my other setups, because I don't ever remember seeing code-lens happening in any of my PowerShell editing. (And I have a lot, going back years.) I don't want to just turn the whole thing off, but that's what I've done just now. Because sanity. In any case, the problem is harder than it looks, as discussed here: microsoft/vscode#23652 (comment) , but I wanted to let this audience know that the larger discussion about how this problem might be tackled may be starting up again here: microsoft/vscode#90235 , and in particular I wanted to draw attention to @baybal's intriguing suggestion here: microsoft/vscode#73413 (comment) By the way, I found this thread via a search: My rather involved thoughts on the topic can be found in this comment: microsoft/vscode#90235 (comment) , where I basically applaud @baybal's mockups, but suggest that the gutter for code-lens should be on the right, with the other cues about information which is semantic in nature. |
This should now be fixed by #4139 |
Use the setting |
Keith I just want you to know you're right, that would have been a much better name and I wish I'd seen this. |
This issue has been marked as fixed. It has been automatically closed for housekeeping purposes. |
Is there a way to turn this off? Thanks!
The text was updated successfully, but these errors were encountered: