Sublime Text 2: Error trying to parse settings

2019-03-14 22:46发布

How do I fix this error?

Error trying to parse settings: No data in ~/Library/Application Support/Sublime Text 2/Packages/User/JavaScript.sublime-settings:1:1

4条回答
唯我独甜
2楼-- · 2019-03-14 23:09

Sublime Text 3 (Build 3059):

My JSON.sublime-settings was containing some XML-structure, no JSON.

Here the previous content of my file:

<dict>
    <key>name</key>
    <string>JSON String</string>
    <key>scope</key>
    <string>meta.structure.dictionary.json string.quoted.double.json</string>
    <key>settings</key>
    <dict>
        <key>foreground</key>
        <string>#E6DB74</string>
    </dict>
</dict>

I replaced it with the default content from SublimePrettyJson:

{
    "use_entire_file_if_no_selection" : true,
    "indent" : 2,
    "sort_keys" : false,
    "ensure_ascii" : false
}

This solved the problem for me. No more annoying error message. OS: Windows 7.

On my Ubuntu machines I never had this error, also not on my Mac.

查看更多
冷血范
3楼-- · 2019-03-14 23:11

Default installs c: / Program Files / Sublime Text 2

Changue by: c: / Program Files / Sublime Text

I do not know why, but it works .. :)

查看更多
Summer. ? 凉城
4楼-- · 2019-03-14 23:21

Please go to ../Library/Application Support/Sublime Text 2/Packages/User/ location and delete JavaScript.sublime-settings:1:1 file which has been created by you or any process must have created that.This would surely work.

查看更多
狗以群分
5楼-- · 2019-03-14 23:23

Most likely you or something has created an empty file in your User config directory.

The config files must be valid JSON. The file in the question is empty and is not JSON.

Try deleting the file or get a fixed version from somewhere (not sure for what the file is being used for)

查看更多
登录 后发表回答