次の方法で共有


Did you know... How to get syntax highlighting for a given file extension? - #097

On the Tools – Options – Text Editor – File Extension page, you can map a file extension to one of the included editors. 

Mapping a file extension .sara to an editor

And after mapping the .sara extension to a C# editor, we now get syntax highlight…

.sara file with C# syntax highlighting

There is also an option to map files without extensions to a specific editor.

Mapping extensionless files to an editor

Technorati tags: VS2005Tip, VS2008Tip

Comments

  • Anonymous
    November 29, 2007
    In Visual Studio 2008 I can't get syntax highlighting mapped to a file like it does in Visual Studio 2005. IN 2005 I have my .asp,.inc and .vbs extensions mapped to the web form editor. Colorization and Intellisense work great for classic asp. Now with the upgrade to 2008 this doesn't seem to work. I'm doing exactly the same thing I did in 2005. See link http://pietschsoft.com/blog/Post.aspx?PostID=757 What am I doing wrong?

  • Anonymous
    November 29, 2007
    Hi Sara, My question is not directly related to the post but this is the only way I could ask this from you. When we create an aspx page in Visual Studio 2005 and dragdrop a control from the toolbox, most of the times the Visual Studio does not allow us to change the name property of that control, however we can change other properties. For example if I dragdrop a TexBox control on my aspx page, I can change all the property of this control other than the name. What I currently do is to change the name in the markup. Do you know any remedy for this? Waiting for you answer right here...... Regards,

  • Anonymous
    November 30, 2007
    Anyone know why VS2008 isn't syntax highlighting my VBS (vbscript) ? I thought I could add .vbs filetype to this and it would sort it, but no luck. .js files work just fine, what's up ?

  • Anonymous
    November 30, 2007
    If you need to set a file extension to one of the editors that isn't an available option (such as the SQL editor), a small bit of registry monkeying can set you up: http://www.engagesoftware.com/Blog/tabid/297/EntryID/117/Default.aspx.

  • Anonymous
    November 30, 2007
    I would love to be able to highlight type parameters. C# 2.0 looks much clearer because of the light blue highlighting applied to type names. I realized last night that I'm back to black type text with type parameters. Is this possible? I realize type parameters fall in the "identifier" category. Thanks!

  • Anonymous
    November 30, 2007
    The comment has been removed

  • Anonymous
    December 02, 2007
    Hey very nice blog for .net tips... I came here from http://arcanecode.wordpress.com/2007/10/16/go-sara-go/ :)

  • Anonymous
    December 11, 2007
    Sara, do you have any insight regarding why Classic ASP/VBScript color coding support was deprecated in VS 2008? See: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=290845 Or better yet, is there a way around this limitation. Even apps like Notepad++ can color code ASP.  It's hard to believe that VS 2008 can't.

  • Anonymous
    December 18, 2007
    No color coding support for classic asp / vbs scripts? I've read the posts linked here in the comments and found where the VS team said they were being deprecated. Who thought that was a good idea? INFURIATING. I won't be recommending my boss buy the new IDE for our team. Microsoft - you're offending one of your staunchest allies - the developers!

  • Anonymous
    January 04, 2008
    I just got VS 2008 as part of my MSDN subscription, installed it and found this little gem of a "feature".  All of the work we do is "classic" ASP - no need for .NET in our products, so this is pretty much useless for our purposes. %#$@!* Idgits. On the bright side - I'll get that 4-5 GB of disk space back when I uninstall VS 2008 and the associated MSDN load (and hopefully not totally bork up 2005 in the process).

  • Anonymous
    July 03, 2008
    In the spirit of both the holiday weekend, I thought i’d mention how Jeff Blankenburg is celebrating

  • Anonymous
    March 04, 2009
    Открыв диалог Tools – Options – Text Editor – File Extension (Сервис – Параметры – Текстовый редактор