SQL highlighting in Visual Studio 2008

Files with the .SQL extension when opened in Visual Studio 2008 have T-SQL syntax highlighting.

How can I convince the editor to apply this syntax highlighting to files with a different extension (in my case .PLPGSQL).

The SQL editor does not appear in the drop-down list under "Tools"> "Options"> "Text editor"> "File extension"> "Editor", and this is the only parameter area where I can see something like what I am after as.

I feel that I am missing something that should be really obvious.

+4
source share
2 answers

I think you now have your own answer, but in any case, for those who will still look ...

You need to play a little with the registry, at least in VS 2008:

First create a key for your extension in "File Extensions", (in my example: .prc)

HKLM:\SOFTWARE\Microsoft\VisualStudio\9.0\Languages\File Extensions\.prc 

Then set the default value: " {FA6E5E79-C8EE-4D37-B79A-5067F8BD5630} "

Gotta do the trick.

+1
source

The location of the registry will differ depending on whether you have a 32-bit or 64-bit operating system.

For a 32-bit installation of Windows, use:
HKLM \ SOFTWARE \ Microsoft \ VisualStudio \ 9.0 \ Languages ​​\ File Extensions

And for a 64-bit installation of Windows use:
(64-bit) HKLM \ SOFTWARE \ Wow6432Node \ Microsoft \ VisualStudio \ 9.0 \ Languages ​​\ File Extensions

As @David points out, you must create a new key for your extension (for example, .tab, .prc, etc.) and set the default value to "{FA6E5E79-C8EE-4D37-B79A-5067F8BD5630}".

+1
source

All Articles