I'm writing a lot of IronPython at the moment and I have a lot of Python scripts in my project.
I seem to remember you can update the Visual Studio text editor to recognise new file extensions and write a XLST (or something) to give you keyword highlighting in the editor for your new language.
Does anyone know how to do this or where I can get more information? Google searches are bringing up things I can buy but not how to extend Visual Studios yourself
Depending on your requirements (and the amount of work you want to put into it) you could write your own language service and register it in VS. This is done using the Visual Studio SDK, it's a bit involved but (luckily) the MSDN sample provides a partially complete IronPython sample. You can get your hands on the sample at http://msdn2.microsoft.com/en-us/library/bb165099(VS.80).aspx
Alternatively, you could also try this (I have VS.NET 2005 so the folders/keys reflect this; modify to your install folders etc.):
1. Create a file called usertype.dat in the C:\Program Files\Microsoft Visual Studio 8\Common7\IDE folder2. Add the new keywords, each on its own line in the dat file3. Create a new registry key for the extension:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Languages\File Extensions\.py]
4. Set the new registry key's (default) value to {8B382828-6202-11d1-8870-0000F87579D2}5. If VS is open, restart 6. Load your python files
Hope this helps
The views, comments and opinions expressed in this post is that of the poster alone unless otherwise indicated.
Diago.co.za
No, I haven't looked at IronPython for ASP.NET (although I'm intrigued) and while I'm using the IronPython engine in one of my applications what I really want to do is write Python code using Visual Studio as supposed to using something like PyScripter and then copy-pasting the code into Visual Studio. I want right-click on my project and click Add -> New Item and select Python file and have keyword sensitivity while I write.
Thanks JacoE, let me check it out. As it stands I have an XSLT with all the Python keywords and stuff so it shouldn't be too hard to convert
Fengol:OK, the end result is that I built my own Python Script editor (using DevExpress for a ribbon/menu system; and ICSharp.TextEditor)
And this open source software is available for download at.....
Unfortunately the editor I wrote is propritory to the project I wrote and my DevExpress toolbox license is owned by my company. When I become bored of my Xbox 360 I'll sit at home an re-write it for open source.
Going Backward Slowly