Sublime Forum

Parse Settings

#1

I have this error message trying to start ST2. It refuses to start. I’ve tried a reinstall. Following the link to NotePad. But can see nothing wrong. Please advise.

This is the full error message:

Error trying to parse settings:Expected value in C:\Users\David, DESKTOP,2520NCF\AppData\Roaming\SublimeText 2\Packages\User\Preferences,sublime-settings:5:2

I’ve followed this link to Preferences,sublime-settings:5:2 where I’ve opened it in NotePad.

There I’ve found the following:

{
	"color_scheme": "Packages/Color Scheme - Default/IDLE.tmTheme",
	"font_size": 12,

	The number of spaces a tab is considered equal to
	    "tab_size": 4,

	Set to true to insert spaces when tab is pressed
	    "translate_tabs_to_spaces": false,
}

The coding book strongly suggests I use ST2 rather than a newer version.

Thanks in advance for any help

Dave

0 Likes

#2

Reinstalling doesn’t help fix problems with your local configuration because the installer doesn’t touch your configuration, only the application files (otherwise, on update all of your customizations would be unceremoniously erased, which is a Bad Move :tm:)

ST2 is not at all recommended since it is long out of support, which includes support for third party packages such as Package Control. Anything that’s recommending it is very much out of date as a result. However, unless it’s a book on writing plugins for Sublime, you should be able to upgrade to ST3 (or even better, ST4) and still follow along with it.

Regardless of that, your problem is indeed on line 5; your file isn’t value JSON data because line 5 and line 8 are text and not "key": value, pairs. Those are the comments that are associated with those particular settings.

You want to either remove those lines, or add // to both of them to mark them as comments so that they’re ignored.

0 Likes

#3

Hi. Thanks for your quick response.

I’m sorry, I don’t understand where you say:

" your file isn’t value JSON data because line 5 and line 8 are text and not "key": value, pairs."

Also, when counting the lines to lines 5 or 8, do you count the line at the very beginning with the ] brace? And do you count line spaces?

Thanks

0 Likes

#4

sublime-settings files are JSON objects; if you’re unfamiliar with that format you can see more about it at https://json.org/ , or use Preferences > Settings - Default to open the default settings and compare what it looks like to your file.

Line numbers are started at 1 and go down from there:

The syntax highlighting here shows the parts of the file that it’s going to be angry about because they’re not valid.

0 Likes

#5

I’ve got it working by doing your suggestion of adding the // for the comment to be ignored when running the code.

Such a simple change for it to work. So I’ve learned something thanks to you.

Thanks for your help, patience and time.

2 Likes