SQL highlighting in Visual Studio 2008
Files with a .SQL extension when opened in Visual Studio 2008 have T-SQL syntax highlighting.
How can I persuade the editor to apply this syntax highlighting to files with a different extension (in my case, .PLPGSQL).
The SQL editor doesn't appear to be an option in the Tools > Options > Text Editor > File Extension > Editor drop down list - and this is the only area of the options where I can see anythin开发者_如何学运维g like what I'm after.
I feel like I'm missing something that should be really obvious.
I guess you now have your answer, but anyway for those who would still search ...
You have to fiddle a bit with your registry, at least in VS 2008:
First, create a key for your specific extension in "File Extensions" (in my exemple: .prc)
HKLM:\SOFTWARE\Microsoft\VisualStudio\9.0\Languages\File Extensions\.prc
Then set the default value to:
"{FA6E5E79-C8EE-4D37-B79A-5067F8BD5630}
"
Should do the trick.
The registry location will be different depending on whether you have a 32-bit or 64-bit operating system.
For a 32-bit Windows installation, use:
HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\Languages\File Extensions
And for a 64-bit Windows installation, use:
(64-bit) HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\Languages\File Extensions
As @David indicate, you then should create a new key for your extension (like .tab, .prc, etc.) and set the default value to "{FA6E5E79-C8EE-4D37-B79A-5067F8BD5630}".
精彩评论