Sublime Forum

Toggle comment not working for C# source files

#1

I’m using Sublime Text 2181 on Windows 64-bit and neither toggle comment nor toggle block comment works for C# files (extension .cs). Nothing happens when I select toggle comment from the edit menu, and the keyboard shortcuts don’t work either. It works fine for C++ and XML miles. How can I fix this?

0 Likes

#2

I have Sublime Text 2 version 2.0.2 build 2223 and found that toggle comment did not work either from the menu selection or the keyboard shortcut for command-/.

So I copied the C++ comments tmPreferences file:
~/Library/Application\ Support/Sublime\ Text\ 2/Packages/C++/Comments\ (C++).tmPreferences

into

~/Library/Application\ Support/Sublime\ Text\ 2/Packages/C#/Comments\ (C#).tmPreferences

And then edited the scope to replace source.c, source.c++, source.objc, source.objc++ with source.cs.

I’m not sure if this is the preferred or recommended approach as I just started using Sublime Text 2 yesterday.

Cheers,
scott

0 Likes