Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual studio 2008 code snippets for another language

Is there a way to define code snippets for another language, other then the default ones (C#, VB ...) in VS 2008 ? I'm using Intel's fortran compiler with Visual studio, and its integration in it is pretty complete apart from the code snippets part. I thought I read somewhere on msdn that you can't define new ones, for other languages.

So I would be really glad if someone could prove me otherwise.

Any help appreciated.

like image 956
Rook Avatar asked Feb 05 '09 20:02

Rook


People also ask

How do I import code snippet to Visual Studio?

Import a code snippet You can import a snippet to your Visual Studio installation by using the Code Snippets Manager. Open it by choosing Tools > Code Snippets Manager. Click the Import button. Go to the location where you saved the code snippet in the previous procedure, select it, and click Open.

How do I change code snippets Visual Studio code?

To create or edit your own snippets, select User Snippets under File > Preferences (Code > Preferences on macOS), and then select the language (by language identifier) for which the snippets should appear, or the New Global Snippets file option if they should appear for all languages.


2 Answers

Code Snippet support for a language is determined by the language service. The Intel Fortran package does not support code snippets and it cannot be added by anyone else (through an add-in or 3rd party package).

The registry key that governs code snippet support is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Languages\CodeExpansions. You'll notice underneath this key there are subkeys for Basic, CSharp and XML (and maybe more if you have other language services that support code snippets) but no subkey for Fortran.

The only thing you can do is make a feature request to Intel and maybe they'll add code snippet support in a few years.

like image 178
Stephen Martin Avatar answered Oct 04 '22 03:10

Stephen Martin


Check out this article on VS and Code Snippets. It was written for VS2005 but is the same for VS2008.

Code Snippets

You should be able to use this with fortran since you specify the code language in an xml file that's used for the snippets.

like image 22
Noah Avatar answered Oct 04 '22 03:10

Noah