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

Support order for targets #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

khalidchawtany
Copy link
Contributor

When showing alternatives for a file I prefer some more frequent used ones to be shown first. Using this PR the config can be done in the following ways:

{
    pattern = "(.*)/models/(.*).php",
    targets = {
        { template = "[1]/models/[2].php",                      label="Model",        enable_new = true , order=1 },
        { template = "[1]/controllers/[2:pluralize].php",       label="Controller",   enable_new = true , order=2},
        { template = "[1]/models/[2:lower]/*fields.yaml",       label="Fields",       enable_new = true , order=3},
        { template = "[1]/models/[2:lower]/*columns.yaml",      label="Columns",      enable_new = true , order=4},
        { template = "[1]/models/[2:lower]/*.*",                label="Model-F",      enable_new = true , order=5},
        { template = "[1]/controllers/[2:pluralize,lower]/*.*", label="Controller-F", enable_new = true , order=6},
    },
},

or non-verbose method:

{
    "(.*)/controllers/(.*).php",
    {
        { "[1]/models/[2:singularize].php",                       "Model",         true, 1},
        { "[1]/controllers/[2:pluralize].php",                    "Controller",    true, 2},
        { "[1]/models/[2:singularize,lower]/_config_form.yaml",   "Config Form",   true, 3},
        { "[1]/models/[2:singularize,lower]/_config_list.yaml",   "Config List",   true, 4},
        { "[1]/models/[2:singularize,lower]/_config_filter.yaml", "Config Filter", true, 5},
        { "[1]/controllers/[2:pluralize,lower]/*.*",              "Controller-F",  true, 6},
        { "[1]/models/[2:singularize,lower]/*.*",                 "Model-F",       true, 7},
    },
},

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

Successfully merging this pull request may close these issues.

1 participant