GithubHelp home page GithubHelp logo

microsoft / vssdk-extensibility-templates Goto Github PK

View Code? Open in Web Editor NEW
33.0 39.0 20.0 60 KB

Visual Studio item templates for building your own extensions

Home Page: http://aka.ms/extendvs

License: MIT License

C# 100.00%

vssdk-extensibility-templates's Introduction

Visual Studio Extensibility Templates

Gitter

This repo contains item templates that help you develop Visual Studio extensions.

We love to hear your feedback! Add templates you would like to see as Issues. Also we welcome pull requests to improve existing or add new templates. Check out the contributing guidelines.

Templates currently included:

  • CommandHandlerTemplate - Add a command handler and hook it up to Visual Studio.
  • OptionsPageTemplate - Add a page to the Visual Studio options dialog.
  • WpfTextViewCreationListenerTemplate - Create a basic implementation of IWpfTextViewCreationListener.
  • PeekProviderTemplate - Add a Peek provider to your VSIX project.

How to use the templates

Download and install the latest build from the releases page.

Creating a template

To create a template, you need to add a new project template or item template project to the VSSDKTemplates.sln. For it to show up in the extension, make sure you add it to the source.extension.vsixmanifest as well.

Extensibility Templates

We use a custom wizard to enable extensibility in templates. In order for you to create templates that use this, you'll have to add these lines to the .vstemplate file:

  • Before </TemplateContent>:
<CustomParameters>
    <CustomParameter Name="$AddVsixManifestAsset$" Value="MefComponentFromSameProject" />
</CustomParameters>
  • Before </VSTemplate>:
<WizardExtension>
    <Assembly>Microsoft.Vsix.TemplatesPackage, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly>
    <FullClassName>Microsoft.Vsix.TemplatesPackage.VsixWizard</FullClassName>
</WizardExtension>

$AddVsixManifestAsset$ supports the following values:

  • MefComponentFromSameProject
  • VsPackageFromSameProject
  • CustomCommand
  • CustomToolWindow
  • ToolboxItem
  • VsPackageWithCustomCommand = VsPackageFromSameProject + CustomCommand
  • VsPackageWithCommandAndToolWindow = VsPackageFromSameProject + CustomCommand + CustomToolWindow

We at Microsoft will look into simplifying this further for extensibility template authors.

VSPackage Templates

VSPackage Templates are tougher to implement. In order to not create a package for each additional VS Package template, we've created a merging system that merges the packages into a single class. For instance, when you add a Tool Window to a blank VSIX project, it will create a package class. If you then add a custom command, it will use the same package that the Tool Window created.

We have an example implementation of an item template in the OptionsPageTemplate. Pay close attention to the .vstemplate and VsPkg.cs files. It is recommended to copy the VsPkg.cs file directly into your template project, to simplify things.

vssdk-extensibility-templates's People

Contributors

alexeyler avatar bertique avatar javierdlg avatar microsoft-github-policy-service[bot] avatar msftgits avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vssdk-extensibility-templates's Issues

Options Page template needs to be "public"

Or it throws InvalidCastException when trying to get the settings.

To Repro
Add an options page (or use an existing working one) for a custom tool (like single file generator)
By default the access modifier is internal

Invoke the custom tool and try to get the properties...

var dte = (EnvDTE.DTE)Package.GetGlobalService(typeof(DTE));
var options = dte.Properties["Your Options", "General"];

Images for VSIX

We should get a preview image and an actual icon instead of using the defaults.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.