nanch / phpfmt_stable

This is a stable snapshot (version 6125cf9) of the phpfmt plugin for Sublime Text
143 stars 34 forks source link

Disable the option of removing a class importing on save state if don't exist inside the file #6

Open giwrgos88 opened 8 years ago

giwrgos88 commented 8 years ago

I have created a class which binds dynamically interfaces and classes from an array. Instead of adding the class namespace in the array e.g

$classes =['\Test\Model\Test'];

I want to add it as use on the top of the file.

screen shot 2016-08-04 at 10 23 44

When I'm saving the file phpftm formats the code and removes the use because it can't detect that the class that I have mentioned on the top is the one on the array. Is there anyway to disable this features so that the phpftm doesn't removes classes which are not mentioned in the file?

rodrigocnascimento commented 7 years ago

Hi @giwrgos88 did you find a way to solve it?

giwrgos88 commented 7 years ago

@rodrigocnascimento not yet

lain0 commented 7 years ago

try these in your phpfmt.sublime.config

    "format_on_save": false,
    "passes":
    [
        "OnlyOrderUseClauses"
    ],

or just ctrl+shift+p and try enable/disable additional transformations