I'm writing an add-in for extending Visual Studio 2008 (adding custom functionality). While doing that I came across a situation where it would be good if I could provide custom messages via tooltips for any line of code.
Doing this IMO requires accessing the VS editor control and by some way displaying the respective tooltip. This might also be visualized like breakpoints that on mouse hovering provide a tooltip message.
Is this implementation possible? If yes, what's the way to go? If not, what similar way do you suggest?
In a recent episode of Hanselminutes, they discussed how much more extensible the VS 2010 editor is going to be. Based on what they said, I think it will be rather difficult (although probably possible) until they introduce that extensibility.
Yes it is. You can add more customization on the code editor of VS 2008, even you can create your own language service with your own intellisense support in VS 2008.
You can do this simply by using VS 2008 SDK, and you can also quickly play with the standalone shell of Visual Studio 2008, and MS SQL Server 2008 Management Studio is one example of customized Visual Studio standalone shell.
You can visit MS Visual Studio Extensibility:
http://msdn.microsoft.com/en-us/vsx/default.aspx
And lots of videos on VS 2008 SDK:
http://msdn.microsoft.com/en-us/vsx/bb507746.aspx#extensibility
You should take a look at Resharper and work out whether your add-in would be better suited to being a Resharper Plug-In. This approach would require your users to buy Resharper, but this sort of thing is exactly what it does.
For example, check out http://stylecopforresharper.codeplex.com/ where this sort of hint/tooltip stuff in Resharper is used to highlight lines of code that have StyleCop issues.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
As a long-time Visual SourceSafe user (and hater) I was discussing switching to SVN with a colleague; he suggested using Git instead. Since, apparently, it can be used as peer-to-peer without a central server (we are a 3-developer team).
I have not been able to find anything about tools that integrate Git with Visual Studio, though - does such a thing exist?
What are the technologies available for using Git with Visual Studio? And what do I need to know about how they differ before I begin?
In Jan 2013, Microsoft announced that they are adding full Git support into all their ALM products. They have published a plugin for Visual Studio 2012 that adds Git source control integration.
Alternatively, there is a project called Git Extensions that includes add-ins for Visual Studio 2005, 2008, 2010 and 2012, as well as Windows Explorer integration. It's regularly updated and having used it on a couple of projects, I've found it very useful.
Another option is Git Source Control Provider.
I use Git with Visual Studio for my port of Protocol Buffers to C#. I don't use the GUI - I just keep a command line open as well as Visual Studio.
For the most part it's fine - the only problem is when you want to rename a file. Both Git and Visual Studio would rather that they were the one to rename it. I think that renaming it in Visual Studio is the way to go though - just be careful what you do at the Git side afterwards. Although this has been a bit of a pain in the past, I've heard that it actually should be pretty seamless on the Git side, because it can notice that the contents will be mostly the same. (Not entirely the same, usually - you tend to rename a file when you're renaming the class, IME.)
But basically - yes, it works fine. I'm a Git newbie, but I can get it to do everything I need it to. Make sure you have a git ignore file for bin and obj, and *.user.
Git Source Control Provider is new plug-in that integrates Git with Visual Studio.
I've looked into this a bit at work (both with Subversion and Git). Visual Studio actually has a source control integration API to allow you to integrate third-party source control solutions into Visual Studio. However, most folks don't bother with it for a couple of reasons.
The first is that the API pretty much assumes you are using a locked-checkout workflow. There are a lot of hooks in it that are either way expensive to implement, or just flat out make no sense when you are using the more modern edit-merge workflow.
The second (which is related) is that when you are using the edit-merge workflow that both Subversion and Git encourage, you don't really need Visual Studio integration. The main killer thing about SourceSafe's integration with Visual Studio is that you (and the editor) can tell at a glance which files you own, which must be checked out before you can edit, and which you cannot check out even if you want to. Then it can help you do whatever revision-control voodoo you need to do when you want to edit a file. None of that is even part of a typical Git workflow.
When you are using Git (or SVN typically), your revision-control interactions all take place either before your development session, or after it (once you have everything working and tested). At that point it really isn't too much of a pain to use a different tool. You aren't constantly having to switch back and forth.
I find that Git, working on whole trees as it does, benefits less from IDE integration than source control tools that are either file based or follow a checkout-edit-commit pattern. Of course there are instances when it can be nice to click on a button to do some history examination, but I don't miss that very much.
The real must-do is to get your .gitignore file full of the things that shouldn't be in a shared repository. Mine generally contain (amongst other stuff) the following:
*.vcproj.*.user
*.ncb
*.aps
*.suo
but this is heavily C++ biased with little or no use of any class wizard style functionality.
My usage pattern is something like the following.
Code, code, code in Visual Studio.
When happy (sensible intermediate point to commit code, switch to Git, stage changes and review diffs. If anything's obviously wrong switch back to Visual Studio and fix, otherwise commit.
Any merge, branch, rebase or other fancy SCM stuff is easy to do in Git from the command prompt. Visual Studio is normally fairly happy with things changing under it, although it can sometimes need to reload some projects if you've altered the project files significantly.
I find that the usefulness of Git outweighs any minor inconvenience of not having full IDE integration but it is, to some extent, a matter of taste.
Microsoft announced Git for Visual studio 2012 (update 2) recently. I have not played around with it yet, but this video looks promising.
Here is a quick tutorial on how to use Git from Visual Studio 2012.
Also don't miss TortoiseGit...
https://tortoisegit.org/
There's a Visual Studio Tools for Git by Microsoft. It only supports Visual Studio 2012 (update 2) though.
Visual Studio 2013 natively supports Git.
See the official announcement.
The Git support done by Microsoft in Visual Studio is just good enough for basic work (commit/fetch/merge and push). My advice is just to avoid it...
I highly prefer GitExtensions (or in less proportion SourceTree). Because seeing the DAG is for me really important to understand how Git works. And you are a lot more aware of what the other contributors to your project have done!
In Visual Studio, you can't quickly see the diff between files or commit, nor (add to the index) and commit only part of modifications. Browse your history is not good either... All that ending in a painful experience!
And, for example, GitExtensions is bundled with interesting plugins: background fetch, GitFlow,... and now, continuous integration!
For the users of Visual Studio 2015, Git is taking shape if you install the GitHub extension. But an external tool is still better ;-)
TortoiseGit has matured and I recommend it especially if you have used TortoiseSVN.
The newest release of Git Extensions supports Visual Studio 2010 now (along with Visual Studio 2008 and Visual Studio 2005).
I found it to be fairly easy to use with Visual Studio 2008 and the interface seems to be the same in Visual Studio 2010.
The simplest solution that actually works quite well is to add the TortoiseGit commands as external tools.
Solution to adding a Git (TortoiseGit) toolbar to Visual Studio
As mantioned by Jon Rimmer, you can use GitExtensions. GitExtensions does work in Visual Studio 2005 and Visual Studio 2008, it also does work in Visual Studio 2010 if you manually copy and config the .Addin file.
Currently there are 2 options for Git Source Control in Visual Studio (2010 and 12):
Git Source Control Provider
Microsoft Git Provider
I have tried both and have found 1st one to be more mature, and has more features. For instance it plays nicely with both tortoise git and git extensions, and even exposed their features.
Note: Whichever extension you use, make sure that you enable it from Tools -> Options -> Source control -> Plugin Selection for it to work.
As of 2013-02-11, the Microsoft Git plugin for Visual Studio 2012 should work with the Express version as well.
Iam used to Eclipse and Java development, but because of my job I need to start coding in C#. I find it a bit annoying that visual studio doesn't autocomplete my blocks. For instance when I write a new function, class or statement am used to that the IDE autocompletes my blocks. So when I type:
private function sendData(String msg, String email) {
and hit enter the closing bracket appears automatically, is there any settings that enables this function in Microsoft visual C# 2010 express ?
This isn't possible with Express versions, since you can't install extensions. You'll need to use Professional or higher and use third party extensions. Some simple free ones will do this (such as Productivity Power Tools), as does the commercial product ReSharper, which does much more more. The later likely would make Visual Studio have other features that you're probably used to comming form Eclipse, such as more refactoring support.
I'm almost certain that the Productivity Power Tools extension will give you this feature. You can find it here:
http://visualstudiogallery.msdn.microsoft.com/d0d33361-18e2-46c0-8ff2-4adea1e34fef
It's really a great add-on and it will give you a lot more control over options like this.
There is no functionality like this already built-in in Visual Studio, but you can install a plugin like Brace Completer to add the functionality .
No, you can't do it by default in Visual Studio. Visit Microsoft Connect to submit a feature request.
A major part of our work is creating and manipulating certain XML files, for which have a custom editor. The editor is starting to get creaky and we are looking at building a replacement. Since VS2010 has recently arrived, ostensibly with an improved add-in architecture (MEF?), I am interested in the possibility of building the editor as a custom editor within Visual Studio.
It would have to appear in the same way as the code editor or the Designer - a tab item, of which there can be many open at once, containing the GUI we use to edit the files. It would integrate with VS's Edit menu. It could use the output window to display messages. It would appear the same as any other editor within Visual Studio.
Right now, I am looking for examples of add-ins that work in a similar way - ideally with source code - to see whether this model would suit our requirements. I am also looking for any documentation or tutorials relevant to creating a VS2010 add-in, or information about VS2008 add-ins if this is still relevant.
Any input is welcome. Thanks!
You want to look at the Managed Extensibility Framework for VS 2010. Since 2010 is written in .net you can create add on components using it.
Code editor extension for VS 2010.
Working with MEF
Custom Editor Extensions
Update:
Since someone asked in a comment, I thought I would post this link on creating add ons for vs 2008: http://msdn.microsoft.com/en-us/vstudio/bb968855.aspx
So I'm now about to look at getting visual studio integration working for our port of the Less ruby library: www.dotlesscss.com. This is basically a CSS preprocessor that extends on the CSS language to give you variables, mixins, nested rules etc...
What we want is to have our .Less file type take advantage of VS's intelligence and syntax highlighting. Now as the Less language is pretty much CSS with a few extra niceties, it would seem sensible to extend on the existing VS support for CSS files.
We have started to look at VS SDK and managed to get as far as colouring all text blue (its a start). But before we start looking at the Lexer impl I really want to know if we can somehow extend whats already been done with CSS support.
Any pointers in the right direction would be appreciated.
Chris.
Regardless of whether you choose 2005, 2008, or 2010, you'll face the same choice - you can pick one or the other but in no way can pick both.
Set .less files to open in Visual Studio's CSS editor - as is.
Write a new language service for Visual Studio from the ground up, with a syntax highlighter and IntelliSense, for your language.
If you choose #2, then you'll be writing what's called a language service for Visual Studio, and there are lots of resources here and on the web (my blog has some). Be warned it's a non-trivial task once you get past simple syntax highlighting.
This is straightforward in Visual Studio 2010, which is now in beta 2. The text editor is completely new and is designed to support this scenario. If you dig into the SDK you'll find a number of related examples.
For VS 2008 and earlier, you can't extend an existing editor. You have to provide a completely new editor that happens to duplicate all the functionality of the existing editor.
I'm developing an application using Visual C# Express Edition - what is the downside to using the express editions? Are there any limitations on what I can build and release? Will my users be able to tell I'm using the Express Edition?
It won't impact your users, other than by making you less productive by prohibiting add-ons such as ReSharper, TestDriven.NET, etc. and not having some of the built-in features of the commercial editions.
To put it another way: if a word processor didn't have a spell checker, you could still make sure that your documents were spelled correctly, so readers wouldn't know - but it's a lot quicker (usually!) if the tool has it built in...
Here is a huge comparison chart of all versions of Visual Studio, from Express until Team System.
Visual Studio 2008 Product Comparison Guide
No AddIns whatsoever - no ReSharper, no TestDriven.net, no VisualSVN, no nothing
Server Explorer does not support remote databases
No support for solution folders
Express targets only a single Framework - Express 2008 targets .net 3.5 only. (Edit: I was wrong, Express 2008 indeed supports multi-targeting)
Reinstalling Express may require re-registration which is free, but can be shut down any time from Microsoft
Apart from that, it's fine. It uses the same compiler to generate the same code, you just don't get all the Time-Saving tools that VS Professional offers.
The Express debugger does not allow Attach to Process:
The ability to attach the debugger to
an already-running process has also
been removed, hindering scenarios such
as writing Windows services and
re-attaching a debugger under ASP.NET
when errors under the original
debugging session cause breakpoints to
be ignored.
I can live with everything else but that.
Only one language is supported. You can't have an application in C# and a library in C++ in the same solution, for instance.
Also, third party ADO.NET providers are not supported in the designers
See features and tools available with Express editions, Visual Studio Standard and Professional editions, and Visual Studio Tools for Office.
It has no mobile device support - one of the most important features, for me :o)
No MFC visual gui builder for C++.
EDIT
Oops - just read the C# tag. I'll leave this up though in case it comes up in a search for anyone else who might also be using c++
Visual Studio Express can do "most" of what the higher editions can do until you start getting into more advanced things such as trying to install third-party components and get full integration, adding database projects, integration into third-party systems, etc. On that note even Visual Studio Standard lacks several of these features so you'd be looking at Professional (at a minimum) to get a fully robust and feature-rich edition.
The current version of VS Express (I'm writing in 2014) has no diagnostics. No assert method and things like stat monitoring. For me this means I'll use a different version to finish a site because it limits testing and validation. No point in making a sub-par .NET site to be actually used.