Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project specific settings doesn't work in ST3 #85

Closed
tom-keim opened this issue Jun 18, 2013 · 10 comments
Closed

Project specific settings doesn't work in ST3 #85

tom-keim opened this issue Jun 18, 2013 · 10 comments

Comments

@tom-keim
Copy link

I'm using ST3. I have a few projects of my own where I love to use PHPCS. But the code I work with for my work is really bad and there is no time to rewrite that.

I would love to be able to enable/disable PHPCS per project. Now I have the following settings in my project settings:

{
    "folders":
    [
        {
            "follow_symlinks": true,
            "path": "path"
        }
    ],
    "settings": {
        "phpcs": {
            "phpcs_execute_on_save": true,
            "phpcs_show_errors_on_save": true,
            "phpcs_command_on_save": true,
            "phpmd_command_on_save": true,
            "phpcs_sniffer_run": true
        }
    }
}

But this is not working. In the default user file these values are false.

I installed PHPCS by Package Controle

@benmatselby
Copy link
Owner

Closed #77 in favour of this one. At the moment you would need to close ST and open it back up again for this to work. Another work around is to open the user settings file, and just re-save it, that performs the refresh of the project settings for it to work again.

Not ideal, but need to get some time to read the API and fix it. Hope this helps in the mean time.

@benmatselby
Copy link
Owner

I've been playing around with this tonight and it seems to be working, which wasn't the case earlier on. I've seen that onProjectLoad or on_project_load has been deprecated and no longer can be used, so I'm thinking that this actually may be a bug in sublime text itself.

@peterfarsinsen
Copy link
Contributor

I'm still seeing somewhat the same issue here with the latest version of ST3.

I can confirm that closing/opening the project or saving the user setting file is the only way to reload the settings. When opening multiple projects at the same time with different settings the settings from the first project wins. Is this supposed to work? Different settings per window/project?

I thought not, so I tried using the "Quick Switch Project" to no avail. My default setting is that phpcs is run on save, but switching to a project that disables this in the project file does not reload the settings.

@joemaller
Copy link

Project settings don't appear to be working for me either using ST3 on OS X. I simplified it down to just toggling phpcs_show_quick_panel between my phpcs.sublime-settings file and the sublime-project file, but the settings file is overriding the project file. Re-launching ST3 has no effect.

@davidgorges
Copy link

Project specific settings don't work for me.
OSX 10.8, Sublime 3 Build 3047

@crynobone
Copy link

Experiencing the same issue on OSX 10.8, Sublime 2 Build 2221

@peterfarsinsen
Copy link
Contributor

I had a go at making phpcs reload settings when the project file changes (I use one window, and quick switch project): peterfarsinsen@e4e3e85

It might not be the prettiest of solutions, but it works very well when using the quick switch project feature. I have no idea if it works with multiple open windows etc.

These are my very first lines of Python, so you guys could probably improve on them ;)

@peterfarsinsen
Copy link
Contributor

Tested my fix with multiple open windows/projects yesterday. Seems to be working as well.

benmatselby added a commit that referenced this issue Nov 10, 2013
@benmatselby
Copy link
Owner

This solution only works for ST3, and not 2 which is a shame. I've merged the patch into master @peterfarsinsen so thanks for taking the time to create it for me. Appreciate it.

@benmatselby
Copy link
Owner

ST2 support seems to be sketchy, but ST3 has been out a while, so not really wanting to spend a great deal of time supporting ST2. Looking at the API reference for ST2 it doesn't even mention project based functions (https://www.sublimetext.com/docs/2/api_reference.html)

Closing ticket

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants