Commenting support requires that the syntax author provides extra metadata to tell Sublime how to comment things, so it sounds like the package that’s providing that syntax doesn’t have that.
Not worry though because you can add it yourself.
The first thing you want to do is open up a GLSL file using it’s own syntax, and then use Tools > Developer > Show Scope Name
and make a note of the first line in the popup; that is the scope that uniquely identifies this type of file.
Next, create a file named glslComments.tmPreferences
in your User
package (only the extension really matters, and you can use Preferences > Browse Packages
to find the User
package if you don’t know where it is).
In the file, put the following content, but replace the GLSL_SCOPE_HERE
with the one that you got from the popup above, then save the file.
As soon as you save the file, you should see the Sublime console tell you that it is generating meta info summary
; if you see that, you should be good to go.
if you don’t see the text, double check the location and name of the file; if it’s in the wrong place or doesn’t have that extension, Sublime doesn’t know what to do with it.
The metainformation here is a duplicate of that used for C/C++ ; you can extend it as needed if there are other ways to comment, etc.
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>name</key>
<string>Comments</string>
<key>scope</key>
<string>GLSL_SCOPE_HERE</string>
<key>settings</key>
<dict>
<key>shellVariables</key>
<array>
<dict>
<key>name</key>
<string>TM_COMMENT_START</string>
<key>value</key>
<string>// </string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_START_2</string>
<key>value</key>
<string>/*</string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_END_2</string>
<key>value</key>
<string>*/</string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_DISABLE_INDENT_2</string>
<key>value</key>
<string>yes</string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_START_3</string>
<key>value</key>
<string>/// </string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_START_4</string>
<key>value</key>
<string>//! </string>
</dict>
</array>
</dict>
</dict>
</plist>