Maya API How-To #24

Back · Previous · Next Maya

How do I enable syntax highlighting for MEL files in .NET?

This requires a registry hack, since Visual Studio offers no facility for configuring new syntax highlighting rules.

Launch "regedit" and browse to the following branch:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.0\Languages\File Extensions

Create a new key here named ".mel". Then open the ".cpp" key and copy its (Default) value to the clipboard. Paste this value into the ".mel" key.

Below is a sample of the two keys, as exported from regedit. Note that the values for the keys may differ in your configuration.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.0\Languages\File Extensions\.cpp]
@="{B2F072B0-ABC1-11D0-9D62-00C04FD9DFD9}"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.0\Languages\File Extensions\.mel]
@="{B2F072B0-ABC1-11D0-9D62-00C04FD9DFD9}"

You'll need to restart .NET to have this take effect.


Acknowledgements

24 Jun 2004