Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imprecise boost exception because of wrong value type when loading (tmLanguage) plist #417

Open
sparr opened this issue Aug 13, 2014 · 3 comments

Comments

@sparr
Copy link

sparr commented Aug 13, 2014

Attempting to load a tmLanguage file containing the following snippet:

    <dict>
        <key>comment</key>
        <string>end of line comment</string>
        <key>match</key>
        <false/>
        <key>name</key>
        <string>comment.line.number-signx</string>
    </dict>

results in this error:

Error loading syntax file "Packages/User/marbelous.tmLanguage": boost::bad_any_cast: failed conversion using boost::any_cast
@FichteFoll
Copy link
Collaborator

Note that this itself is not a bug, but that Sublime Text's error message should be clearer.

@FichteFoll FichteFoll changed the title plist loader encounters boost exception when loading empty dict value Imprecise boost exception because of wrong value type when loading (tmLanguage) plist Aug 13, 2014
@FichteFoll
Copy link
Collaborator

There were improvements to this in 3068. You can now get the following error messages:

    <duct>
        <key>match</key>
        <string>//.*</string>
        <key>name</key>
        <string>comment.single.line.sublime-settings</string>
    </duct>

error parsing lexer: ...tmLanguage: Unrecognised plist element duct

    <array>
        <key>match</key>
        <string>//.*</string>
        <key>name</key>
        <string>comment.single.line.sublime-settings</string>
    </array>

error parsing lexer: ...tmLanguage: Unrecognised plist element key

    <dict>
        <key>match</key>
        <string>//.*</string>
        <key>name</key>
    </dict>

error: Error loading syntax file "...tmLanguage": Expected value

The example in OP yields the following error:

error: Error loading syntax file "...tmLanguage": Wrong type for key match expected string


All in all, the error messages are pretty workable, except that they don't show where the error occured and that "Unrecognised plist element key" is shown instead of "expected array" or "expected dict". I'll leave this issue open for that and reduce severity back to trivial.

@FichteFoll
Copy link
Collaborator

Color schemes could also use some love.

If I change a value from being a string to an integer I get the following:
error: Error loading colour scheme ...tmTheme: Unabled to open color scheme ...tmTheme: malformed plist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants