If you are programming in C# in Visual Studio and type in "prop" and hit enter, the IDE generates a property. Eclipse also has this feature and the user can define custom commands that expands into custom code. Is this possible in Visual Studio?
Thanks to leppie's comment I managed to find the solution on my own: http://msdn.microsoft.com/en-us/library/ms165392(v=vs.80).aspx
Related
I am working on a asp.net MVC project in Visual Studio 2019.
I am watching a tutorial and the tutor uses Visual Studio 2015. His editor shows parameter name beside parameter, like this:
While my editor doesn't:
Does any one know what setting, feature or extension is that?
It's called "inline parameter name hint". Not sure how VS 2015 can have it since even Resharper only introduce it on 2018 (maybe CodeRush or another extension?), but if you're using the latest VS, it's available under the Editor Help group from Tools-Options-Text Editor-C#-Advanced. This feature is turned on by default in all IDEA-based IDE (Rider, Android Studio, PhpStorm, etc) so expect more people to be used by it.
We are using a commercial software that has its own scripting language with which you can customize the product. It is very tedious to write code in it without any help from an IDE and it has its own compiler.
Is it possible to use Visual Studio and create an environment for me to write scripts in this language and get the help of intellisense and syntax highlightning and other good things you find in an IDE? Ideally I would like to bind a button in VS to launch the external compiler and compile the code so I don't have to switch windows all the time as well.
If this is possible is it a very hard thing to accomplish?
Yes, this is certainly possible. You need to create a Visual Studio Shell add-in with custom language services and text editors. You need to install the appropriate Visual Studio SDK and then you'd continue to:
Create a custom Editor and/or designer
Add a language service
Add Project and Item templates
You're allowed to ship Visual Studio Isolated Shell with your application (license required and there are some limitations) so that your users don't need to have Visual Studio Professional installed.
There are a number of open-source projects that provide a custom editor, language services etc in Visual Studio, these could provide a nice place to research how things are done, next to teh Visual Studio SDK documentation:
PyTools, which is a Visual Studio editor for IronPython
Phalanger, which contains a Visual Studio editor for PHP
PoShTools, a Visual Studio service for PowerShell editing right inside Visual Studio
You'll probably want to dig into MsBuild as well, since Visual Studio will expect you to create a project file if you want to edit a collection of files and compile them. MsBuild could in turn call your own compiler, like it calls csc to compile C# code for example.
Creating Project Types
In Visual Studio 2010, I have a CLR C++ console project that I would like to change into a Forms project, so that I can add a form and use the designer and whatnot. Is there a good way to do this?
Compare the old project templates then make necessary changes like adding references to winforms and changing the entry point function from winmain back to main.
See http://jiangsheng.net/2012/12/17/how-to-migrating-a-clr-console-visual-c-project-to-windows-forms/ for details. This article is written for 2012 but should work in 2010.
Ok, i already know how to create a new project template using export template feature from visual studio 2010. Now, what I'd like to know is how can I create an item or add a reference to an dll dynamically based on user selected option in wizard interface.
I know that is possible to use conditional and loops within visual studio project template, but how can I change the output project?
I want to add Intellisense for .xyz file types which is my own language.
How should i proceed?
You can create your own language services using the Visual Studio SDK.