Sublime Forum

Package looks up settings in the wrong folder

#1

My SublimeLinter doesn’t work anymore (on MacOS Mojave).

When trying to change settings for it, I get returned a console error:

Unable to open /Users/myuser/Library/Application Support/Sublime Text 3/Packages/SublimeLinter/SublimeLinter.sublime-settings

But SublimeLinter is not a default package, it was installed via PackageControl. So it’s actual position is under

/Users/myuser/Library/Application Support/Sublime Text 3/Installed Packages/SublimeLinter/SublimeLinter.sublime-settings

Why is it behaving incorrectly?
How do I fix?

Also, is worth mentioning that when I open the custom settings via “Preferences -> Package Settings -> SublimeLinter -> Settings” it’s opening a file at

/Users/myuser/Library/Application Support/Sublime Text 3/Packages/User/SublimeLinter.sublime-settings

All this is pretty confusing… :thinking:

0 Likes

#2

I don’t use the package personally so I don’t know why it might not be working for you. However, I can clear up your confusion on the other aspects of this.

Packages in Sublime can be installed in two different formats (loose files and sublime-package files) and they can be installed in three different places. Regardless of the format or the location used, Sublime sees all packages as being part of a virtual resource space named Packages.

This distinction makes it possible for a package to be installed in any of the available locations and formats without any changes; if for example a package wanted to open a file from within itself, then the code would need to be different depending on where it was installed.

This error is unrelated to your general problem and is just sort of a “quirk” of Sublime. The command to open the settings wants to open a new window with the default settings from the package in the left, and your user settings on the right.

When trying to open a package resource, Sublime tries to load a version from the physical Packages folder first, and if that fails it looks in the sublime-package file and loads the version there instead. So this message is alarming but harmless; you’ll see a similar error if you choose Preferences > Settings (or in your case Sublime Text > Preferences > Settings, since you’re on a Mac). There is a message about not being able to load the default preferences, but they still appear in the window.

This is also expected. When Sublime loads many resource files (including sublime-settings files) from a package, it looks for all of the files with the same name across all of the packages and it merges them together into one final file. The merge happens in a specific order which defines that the settings from the User package are always applied last.

So this means that the settings used are always the default values, except for any settings that you add to your User version of the preferences file; the settings in there overwrite the ones in the base file.

Again if you check the standard user preferences, you can see that the file in the left is from the Default package while the file on the right is from your User package.

I did a video demystifying packages as well as one on how configuration works that may be helpful as well.

0 Likes