csch0 / SublimeText-Preference-Helper

Helps you to fill out the Sublime Text 2/3 sublime-settings files. This version is compatible to Sublime Text 2 and 3
21 stars 1 forks source link

Autocompletion popup of preferences available #5

Closed edubkendo closed 11 years ago

edubkendo commented 11 years ago

In your second image, you show yourself getting various preferences suggested to you in the autocomplete popup. How did you get that to work? Is there a set of snippets?

csch0 commented 11 years ago

Nope, this are no snippets, Preference Helper is parsing the original setting file and provides all available settings (which are not already implemented in the user file) in that list.

edubkendo commented 11 years ago

This is a very cool feature, potentially very helpful. I had initially asked because when I first tried it, it did not seem to be working for me. I think it is related to having a large number of settings already in the file. This was the user preferences file I was initially testing it out in: Preferences.sublime-settings . If I deleted one of those settings and then began to type it, no autocomplete popped up at all.

However, after you answered and confirmed what it was supposed to do, I tried again, this time though, I first copied all the settings to a temporary buffer, so I was working with an empty settings file, saved it, and then it worked like a charm. Very cool.

Fill it up again and it stops. So, a couple things come to mind for me. Either it is too many settings in the file that's throwing it off, or I have something particular in my file that is breaking it. Perhaps a non-existent setting or something, or improperly formatted json.

I imagine this is probably fairly low-priority but thought I should go ahead and explain it anyways.

Very nice work, this plugin is very useful to me.

csch0 commented 11 years ago

Thanks for the feedback, yes I also think that it is very useful since I always forget the default setting names and than I have to check it copy it and so on.. so a real time saver for me.

Yes the setting file must be valid right now to detect everything right, if it is not filling anything probably you forgot an comma "," at the line before and so the scope is not set right.

edubkendo commented 11 years ago

Ha! I just figured it out. Like I said, when I first went to test it out, my user's preferences had pretty much all the settings in it. So I naturally just deleted one of them, typed "a", and expected to see a popup with atomic_save, which didn't occur. That's because, even though I had deleted a setting, it was unsaved. Your plugin must be reading from the file on disk, rather than the current buffer (which makes total sense) , so where it was looking the setting had never been deleted. So, if I delete a setting, then save the file, then try, it pops up just like it should. Rather silly on my part.