Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 609
Rajanand Ilangovan Avatar asked Dec 23 '12 18:12

Rajanand Ilangovan


2 Answers

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.

like image 192
d_rail Avatar answered Sep 22 '22 09:09

d_rail


The above answers helped me out on sublime text 3

But just wanted to add this...

For newbies like me, if you want to add your custom settings and you tried adding it to the Preference file and you're getting the error too... In my case I did like the following...

{
    "ignored_packages":
    [
      "Vintage"
    ], // <-- I put the comma there so I can add the below, new setting.

    "tab_size": 2 //My new setting
}
like image 43
GaryP Avatar answered Sep 19 '22 09:09

GaryP