Display CodeLens above attributes

孤街浪徒 提交于 2019-12-04 16:09:24

问题


It is quite annoying to see codelens reference between the field and field's attributes. It requires to add a lot of additional spaces around to make everything readable. Is it possible to display CodeLens reference above the attributes?


回答1:


No, this is currently not possible.

If you'd like to see this, I suggest you give the product team a shout-out on the Visual Studio UserVoice and post back the link as a comment to this answer. I'd suggest not to move the code lens information, but to suggest the location to be made configurable :).

Though I can't disclose any details, I've seen your feedback before and I know it has been considered, but rejected.




回答2:


This is an old question but as update to @jessehouwing this is Visual Studio team answere:

Dear supporters for this suggestion

Thank you for your feedback on this idea.

We designed the Code Lens indicator to be as close to the actual function declaration as possible, to allow you to make a better cognitive connection with it. At one point during the development of Code Lens, we actually tried locating it above the attributes as this suggestion requests. It looked great in simple cases, but unfortunately it started to feel “disconnected” from the declaration when more attributes were added. It really looked strange at around three attributes, but started feeling a bit odd around two.

Here’s a pathological “real world” case which illustrates this -

https://github.com/dotnet/roslyn/blob/master/src/VisualStudio/CSharp/Impl/CSharpPackage.cs#L26

Imagine the indicator above the attributes in this case.

For this reason, we’re declining this suggestion at present.

Thanks! Mark Wilson-Thomas Program Manager, Visual Studio Editor Team

So sadly it wont be fixed, but after reading whole answere I have to agree.



来源:https://stackoverflow.com/questions/22447557/display-codelens-above-attributes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!