Display CodeLens above attributes - visual-studio

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?

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.

This is an old question but as an update to #jessehouwing this is Visual Studio team answer:
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 won't be fixed, but after reading the whole answer, I have to agree.

Related

Trying to create a custom functoid in Biztalk 2010. Trouble getting resources to show (all null)

First time poster here, so if you need more info or when I am too vague, please say so.
We are using Biztalk 2010 here, together with (of course) VS 2010 (Ultimate in my case, not that it matters) on a 64bit server.
I need to create a custom functoid and have done this (enough tuts on the web, albeit usually for older versions of Biztalk).
What I have problems with now are getting the name, tooltip, description and icon to show up when I add my custom dll to the Toolbox. Whatever I try with my resources, I cannot for the life of my have them appear in Toolbox (always null).
Picture link is below, I am not allowed to include more than 2 hyperlinks in my message yet.
I have used this link as (one of my) sources : http://www.eggheadcafe.com/tutorials/aspnet/f843db77-a775-415e-bd08-71c2b1127e40/biztalk-writing-and-usin.aspx
I must be doing something wrong in a stupid way, but I am at the end of my wits here. So, if anyone can please take my hand and help me through this ordeal.. please.. don't let me hold you back.
Thanks in advance !
http://i.stack.imgur.com/3UAJ6.png
Solution by the original author (Dennis):
I copied the sample functoid solution from Microsoft into a new project. Used that as a basis to create my own functoids and all is good. Not really the way to go I suppose, but it worked. The reason for my problem (I think) might have been the blank custom tool namespace on the properties of the resources.

Is there anything like Eclipse Perspective in Visual Studio?

I was wondering if there's anything like Eclipse Perspectives in Visual Studio (2008 or 2010).
For those unfamiliar with Eclipse, here's a definition of Perspectives:
A perspective is a visual container
for a set of views and editors
(parts). These parts exist wholly
within the perspective and are not
shared. A perspective is also like a
page within a book. It exists within
a window along with any number of
other perspectives and, like a page
within a book, only one perspective is
visible at any time.
Let me give you a visual example:
Java Perspective:
SVN Repository Perspective:
Maybe there is nothing like that straight out of the box, but with some plugin. If that's the case, it'll also be a valid answer.
Thanks for your time.
I used Brian's blog post as a starting point and made a VS2010 extension: http://perspectives.codeplex.com/
More info here: http://csharpening.net/blog/?p=292
It's probably not as complete as the VSWindowManager but lets you save your configurations and create new ones. Let me know if it works out!
I found this http://vswindowmanager.codeplex.com/ but it's for 2005.. there is a branch for 2008 in the source code but i don't know if it works... I think I'll give it a try and post any results...
It would be great if it works also for 2010!!! When you work in 1024*768 it's really annoying to rezise the windows every two seconds!!!
Good luck!!
You can check out my blog post which provides the ability to list and switch window layouts in Vs2008 and Vs2010: http://www.brianschmitt.com/2010/09/save-and-change-tool-layout-in-visual.html

Is it really worth purchasing R# for VS2010?

I heard that R#5.0 (still in beta) will support VS 2010. My question is
VS2010 == VS2008 + ReSharper ?
I know there are many improvements to VS2010, so I 'm not sure weather is it really worth purchasing the R#5.0 for VS2010?
Well, I haven't explored VS 2010 new refactoring features that much, but its my understanding that VS has some but definitely not all of resharpers features implemented (From MSDN):
Navigate To
You can use the Navigate
To feature to search for a symbol or
file in the source code.
Navigate To lets you find a specific
location in the solution or explore
elements in the solution. It helps you
pick a good set of matching results
from a query.
You can search for keywords that are
contained in a symbol by using Camel
casing and underscore characters to
divide the symbol into keywords.
For more information, see How to:
Search for Objects, Definitions, and
References (Symbols).
Generate From Usage
The Generate From
Usage feature lets you use classes and
members before you define them. You
can generate a stub for any undefined
class, constructor, method, property,
field, or enum that you want to use
but have not yet defined. You can
generate new types and members without
leaving your current location in code,
This minimizes interruption to your
workflow.
Generate From Usage supports
programming styles such as test-first
development.
IntelliSense Suggestion Mode
IntelliSense now provides two
alternatives for IntelliSense
statement completion, completion mode
and suggestion mode. Use suggestion
mode for situations where classes and
members are used before they are
defined.
In suggestion mode, when you type in
the editor and then commit the entry,
the text you typed is inserted into
the code. When you commit an entry in
completion mode, the editor shows the
entry that is highlighted on the
members list.
When an IntelliSense window is open,
you can press CTRL+ALT+SPACEBAR to
toggle between completion mode and
suggestion mode.
So I guess it would depend on which of Resharpers features you want to use. If you are satisfied with the above which is certainly great improvements, then you don't need Resharper.
On the performance question, well it might perform better because of tighter integration.
Personally the above leaves me still needing a lot of features like (just the ones i can think of right now - might be more):
There are as far as I can tell only about 6 refactorings, where resharper currently has more than 30
No import type completion, which i use ALL the time. One shortcut adds to references and adds import statement
No smart completion
Change namespace to follow navigation structure and update all references with one shortcut
Goto is more advanced in R# you can go to inheritors and bases,
file member, recent files and edits and theres the fast goto feature
Resharpers static analysis is far more comprehensive than what you get from VS
So what do you need? (I am definitely not giving up Resharper)
Peter,
Best person that can answer this question is yourself. What I suggest is you download it, learn it (and note I said learn it, not just play with it). Then decide. However, I'll warn you that it's quite addictive.
My question is VS2010 == VS2008 + ReSharper ?
Oh hell no. VS2010 has more features than VS2008, and some of those feature ideas were stolen from ReSharper, but vanilla VS2010 is still a long way behind VS2010 + ReSharper 5 or even VS2008 + ReSharper 5.
From a quick glance at my 31 Days of ReSharper blog posts (written back in the R# 2.5 days), here are just a few ReSharper features that are still not present in VS2010: (Please correct me if VS2010 does have any of these -- I haven't actually used it that much without ReSharper!)
Unused code highlighted in gray and with quick-fixes to delete the unused code for you (this is just one of many hints and warnings R# does that VS does not)
Visual indication of where you have hints, warnings, and errors in a source file (colored stripe next to the vertical scroll bar)
Integrated unit-test runner that's not locked down to only MS's test framework
Shared settings for code formatting, code templates, etc. -- check these settings into version control, and they'll be picked up automatically by other computers (no manual export/import)
Go To Type -- a pop-up window where you can enter a type name (or part of the name) and jump straight to the right source file
Navigate to derived types / overriding methods
Code Structure View -- view a list of members in your type, and drag/drop to reorder them in your source code
R# will suggest variable names for you
You can invoke an Intellisense dropdown that shows types from all namespaces (and then it adds the using for you)
It's eerily good at guessing what you meant when you tell it to fix an error for you
Remove unused braces and Invert If
Generate Code (I particularly like Generate Equals and GetHashCode, even though I use them very rarely)
Viral Rename (if you rename a type, it'll also suggest that you rename any variables that were named after the type)
And best of all, Safe Delete.
Safe Delete rocks.
And that's just the features that R# had in 2.5 when I wrote the 31 Days of ReSharper. They've added plenty of new features since (I just don't have a comprehensive list handy). A couple of my favorites are the background solution-wide analysis, which will tell you in nearly real-time if you have compiler errors anywhere in your solution, and Inspect > Value Origin, which is just wicked cool.
If your having to ask the question, my guess is that you're not using ReSharper to its full potential. Personally I find that R# writes most of my code for me and I feel like a noob using visual studio without it.
YES. unequivocably YES.
After migrating to Visual Studio 2010 we asked our development team if buying Resharper upgrades is worth the investment. The votes were unanimous: yes!
Btw: we use VS2010 Premium and the devteam has its own budget.
Why don't you try out the R# 5 betas and then you can decide if you're using enough of its features to justify purchasing it.
http://confluence.jetbrains.net/display/ReSharper/ReSharper+5.0+Nightly+Builds
ReSharper has been around long enough that developers might purchase the upgrade just out of habit! :)
I recall that when VS2008 was released, R# wasn't quite ready, and there was griping among the .NET community about it. "Must...have...ReSharper!". Heh. Jetbrains appear to be on top of it this time though.

Class view in Visual studio

I see that I would benefit from using the class view in visual studio.
It would give me better overview over my classes, their methods and make it easier for me to see where and when to refactor my class. I assume that it would give me a better structure and enhance the readability of my code.
But....
I find it to awkward to use. I tried to get use it instead of solution explorer, It basically stranded before beginning. I find no similar functionality like "Track Active item in solution explorer".
Any idea on getting started on using the class view or that I just should forget it and stick to solution explorer and stay ignorant? ;)
Some years ago some people were sure that writing code will no longer exists and everything is going to be UML modeling, so I guess they were wrong.. its great power is initial model(as it name tells). Personally I found it slow clicking with the mouse and prefer writing my classes with coding..
The most important thing is to be productive. My advice is to try it (it helps in design), but if you don't feel comfortable with it, don't worry, a lof of good programmers don't know that it even exists :)

Class Designer in Visual Studio - is it worth it?

Does anybody use the Class Designer much in Visual Studio?
I have downloaded the Modeling Power Toys for 2005 and have been impressed with what I've seen so far. The MSDN Class Designer Blog doesn't seem to have been updated for a while but it still looks quite useful.
Is the Class Designer a quick way to build the basic application or should I just work out on paper and then start coding?
Thanks
As a visualization tool, or for exploratory purposes (drawing up multiple options to see what they look like) it's not bad, but generally I find the object browser does fine for most stuff I care about.
As a code generation tool, it's a terrible idea.
The whole idea that we will design all our code structure first, then fill in the blanks with small bits of implementation is fundamentally broken.
The only time you actually know what the code structure should look like, is if you've done the exact same thing before - however then you can just use your previous code, and you don't need to draw up any new code in any kind of designer.
If you decide ahead of time to use a particular class structure before you've actually tried to solve the problem, there is a 100% chance that you will pick the wrong design, and shoot yourself in the foot.
Short answer: No.
Longer answer: No, not at all. There's a reason it hasn't been updated.
[EDIT] # MrBrutal - Sorry - do you mean to generate code or just represent a design? Because I took your question as to generate code for you.
I guess this is old, but I use it a lot. It could definitely be improved, but I find it extremely useful to be able to visualize my class structure, and to be able to jump to a specific class or method by clicking on it visually.
It's also slightly easier to add classes/interfaces with than the solution explorer, although the new files always end up in the root folder, instead of the same folder as the CD.
The main benefit I find is to be able to see a group of closely related classes at once. I think the best approach might be to have a single CD for each code folder/namespace.
I've used it a couple of times to get some decent looking class diagrams to put in presentations/blogposts etc. But thats about it...
Any suggestions on other simple UML/class diagram tools that is easy to use and create some nice looking diagrams? Must be able to generate diagrams from .NET code.
I have tried it out couple of times, mainly for viewing existing classes.
If it would show all the relationships, it would be more usefull. Now it only shows inheritation.
I find it useful sometimes, more often for documentation afterwards.
It's a new little utility, but I don't think you get the full functionality in VS Pro - I think you need Architect's Edition.
The comments here suggest that few people find the class designer useful.
Amusing to note that Microsoft designed the class designer to be a useful replacement to useless UML (UML diagrams being untrustworthy once they lose synchronisation with source code).
The trouble with class diagrams is that they tell us what we already know.
I only use the class designer to display my existing classes, but I don't use it the other way, e.g., design your classes there then let it generate the code.

Resources