Search code examples
error-handlingpackagetext-editorsublimetext2

Sublime Text 2 Error Trailing comma before closing bracket


I changed the user setting from preference and saved it. Then i tried to open editor but i get the error message. So i uninstalled and installed it again. Though, no use. Also the path mentioned in the error message also is not there.

The error message is:

Error trying to parse setting: Trailing comma before closing bracket in C:\Users
Rajanand\AppData\Roaming\Sublime Text 2\Packages\User\Preferences.sublime-settings:5:1

What am I missing here?


Solution

  • Go to Preferences > Settings - User. AppData is hidden by default in Windows, show with the explorer's folder options.

    Your problem is that you have an extra comma somewhere in that file. Remove the comma from the last setting in any list. Without seeing that file, I can not tell you where exactly. Here are examples:

    {
      setting1,
      setting2,
      last_setting,<-- remove
    }
    

    Remove the comma from the last setting.

    or

    {
      setting1,
      setting2:
      [
        setting2_item1,
        setting2_last_item,<-- remove
      ]
    }
    

    Remove the comma from setting2_last_item.

    or

    {
      setting1:
      [
        setting1_item
      ],
      setting2:
      [
        setting2_item
      ],<-- remove
    }
    

    Remove the comma after setting2's list.