title: Supporting user-specified file extensions in custom Visual Studio language service
body: <p>I'm working on a custom Visual Studio language service, and have several questions regarding the way file extensions are bound to a particular language service.</p>
  
  <p>Source files for the language "Example Language" has two primary file extensions: <code>.e1</code> and <code>.e2</code>. My extension has a class <code>ExampleLanguagePackage</code> which extends <a href="http://msdn.microsoft.com/en-us/library/vstudio/microsoft.visualstudio.shell.package.aspx"><code>Package</code></a>.</p>
  
  <ol>
  <li><p>When you use the File &rarr; Open command and select a C# file (for example), the "Open" button has a dropdown arrow which allows you to select "Open With...". When you click that button, you are presented with options to open the file in the "CSharp Editor (Default)", "CSharp Editor with Encoding", or any of several other options. How can I provide a similar feature for my language, offering "Example Language (Default)" and "Example Language with Encoding" options?</p></li>
  <li><p>When you open Tools &rarr; Options... &rarr; Text Editor &rarr; File Extension, you have the ability to bind (for example) the <code>.foo</code> extension to "Microsoft Visual C#" or any of several other options. How can I extend this page to allow user-defined file extensions to be associated with the "Example Language"?</p></li>
  <li><p>What else should I watch out for when registering these items?</p></li>
  </ol>