GDScrip comments not working in Sublime Text

woopdeedoowoopdeedoo Posts: 74Member
edited August 2017 in General Chat

Pressing the keys to toggle comments does nothing, and comments don't get colored by the syntax highlighter (they show up as if they were plain text).

In GDScript.tmLanguage file there's this, but I barely know anything about regex (or ST's context definitions), so I can't tell what's wrong with it:

<dict>
    <key>match</key>
    <string>(#).*$\n?</string>
    <key>name</key>
    <string>punctuation.definition.comment.gdscript</string>
</dict>

Answers

  • woopdeedoowoopdeedoo Posts: 74Member
    edited August 2017

    The last 4 lines were supposed to be xml nodes. Sorry I forgot to format it as code.
    Disregard this (couldn't find the button to edit posts :| It's been a while since last time I used these forums).

  • BauxiteBauxite Posts: 2Member

    I have this issue as well. I hope some regex gods come along and discover what's wrong with it, because it looks fine to me. Maybe the parentheses need to be removed?

  • woopdeedoowoopdeedoo Posts: 74Member
    edited August 2017

    I included punctuation.definition.comment.gdscript in the comment part of my theme file and it now colors the comments, at least. Like such:

    <dict>
        <key>name</key>
        <string>Comment</string>
        <key>scope</key>
        <string>comment, punctuation.definition.comment.gdscript</string>
        <key>settings</key>
        <dict>
            <key>foreground</key>
            <string>#967f75</string>
        </dict>
    </dict>

    My only problem now is with not being able to toggle the comments with the shortcut keys. I've tried several possible regex combinations suggested around the internet for detecting python comments, but none of them worked. My guess is there's something wrong with the context definition for GDscript. I looked at the YAML-tmLanguage file, but once again I can't tell what could be wrong...

Sign In or Register to comment.