Trevor Hickey
Trevor Hickey

Reputation: 37806

How do I enable spell check on my sublime language file?

I wrote my own .tmLanguage file for sublime, but I can't figure out how to enable spell checking for it. Spell checking must be an option encoded in the language file, because not everything would require checking (usually just comments).

I can't find any documentation that mentions how one would target particular keys to require spell checking. It must rely on some kind of attribute or key name?

I don't think it has anything to do with settings: "spell_check": true is already enabled in the preferences.

Upvotes: 2

Views: 570

Answers (1)

Trevor Hickey
Trevor Hickey

Reputation: 37806

My tmLanguage file looked something like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>fileTypes</key>
        <array>
            <string>LanguageName</string>
        </array>
        <key>name</key>
        <string>LanguageName</string>
        <key>patterns</key>
        <array>
            <dict>
                <key>begin</key>
                <string>(</string>
                <key>end</key>
                <string>)</string>
                <key>name</key>
                <string>TOKEN_NAME</string>
            </dict>
        </array>
        <key>scopeName</key>
        <string>source.Language</string>
        <key>uuid</key>
        <string>172ddd2d-11e8-45b2-a3cc-cjf1ffa60e56</string>
    </dict>
</plist>

It turns out that, my scopeName needed to be:
<string>text.Language</string> instead of <string>source.Language</string>.

*The .Language is my language file extension, and yours will vary.

Upvotes: 2

Related Questions