Skip to content

Commit 2398da9

Browse files
committed
Refactor menu, command palette and settings
1 parent 0310c51 commit 2398da9

File tree

5 files changed

+79
-82
lines changed

5 files changed

+79
-82
lines changed

Context.sublime-menu

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
[
2-
{ "caption": "-" },
3-
{
4-
"caption": "Getters and Setters",
5-
"children":
6-
[
7-
{ "command": "php_generate_getter_for", "caption": "Generate Getter for ..." },
8-
{ "command": "php_generate_setter_for", "caption": "Generate Setter for ..." },
9-
{ "command": "php_generate_getter_setter_for", "caption": "Generate Getter and Setter for ..." },
10-
{ "caption" : "-" },
11-
{ "command": "php_generate_getters_setters", "caption": "Generate All" },
12-
{ "command": "php_generate_getters", "caption": "Generate Getters" },
13-
{ "command": "php_generate_setters", "caption": "Generate Setters" },
14-
{ "command": "php_generate_getters_setter_unavailable", "caption": "" }
15-
]
16-
}
2+
{ "caption": "-" },
3+
{
4+
"caption": "Getters and Setters",
5+
"children": [
6+
{ "command": "php_generate_getter_for", "caption": "Generate Getter for ..." },
7+
{ "command": "php_generate_setter_for", "caption": "Generate Setter for ..." },
8+
{ "command": "php_generate_getter_setter_for", "caption": "Generate Getter and Setter for ..." },
9+
{ "caption" : "-" },
10+
{ "command": "php_generate_getters_setters", "caption": "Generate All" },
11+
{ "command": "php_generate_getters", "caption": "Generate Getters" },
12+
{ "command": "php_generate_setters", "caption": "Generate Setters" },
13+
{ "command": "php_generate_getters_setter_unavailable", "caption": "" }
14+
]
15+
}
1716
]

Default.sublime-commands

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,36 @@
11
[
22

3-
{
4-
"caption": "PHP: Generate Getters and Setters",
5-
"command": "php_generate_getters_setters"
6-
},
7-
{
8-
"caption": "PHP: Generate Getters",
9-
"command": "php_generate_getters"
10-
},
11-
{
12-
"caption": "PHP: Generate Setters",
13-
"command": "php_generate_setters"
14-
},
15-
{
16-
"command": "php_generate_getter_for",
17-
"caption": "Generate Getter for ..."
18-
},
19-
{
20-
"command": "php_generate_setter_for",
21-
"caption": "Generate Setter for ..."
22-
},
23-
{ "command": "php_generate_getter_setter_for", "caption": "Generate Getter and Setter for ..." },
3+
{
4+
"caption": "PHP: Generate Getters and Setters",
5+
"command": "php_generate_getters_setters"
6+
},
7+
{
8+
"caption": "PHP: Generate Getters",
9+
"command": "php_generate_getters"
10+
},
11+
{
12+
"caption": "PHP: Generate Setters",
13+
"command": "php_generate_setters"
14+
},
15+
{
16+
"caption": "PHP: Generate Getter for ...",
17+
"command": "php_generate_getter_for"
18+
},
19+
{
20+
"caption": "PHP: Generate Setter for ...",
21+
"command": "php_generate_setter_for"
22+
},
23+
{
24+
"caption": "PHP: Generate Getter and Setter for ...",
25+
"command": "php_generate_getter_setter_for"
26+
},
27+
{
28+
"caption": "Preferences: PHP Getters and Setters",
29+
"command": "edit_settings",
30+
"args": {
31+
"base_file": "${packages}/PHP Getters and Setters/PHP Getters Setters.sublime-settings",
32+
"default": "// See the left pane for the list of settings and valid values\n{\n\t$0\n}\n"
33+
}
34+
}
35+
2436
]

Main.sublime-menu

Lines changed: 31 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,33 @@
11
[
2-
{
3-
"id": "tools",
4-
"caption": "Tools",
5-
"children":
6-
[
7-
{
8-
"caption": "PHP Getters and Setters...",
9-
"command": "show_overlay",
10-
"args": {"overlay": "command_palette", "text": "PHP: Generate" }
11-
}
12-
]
13-
},
14-
{
15-
"caption": "Preferences",
16-
"mnemonic": "n",
17-
"id": "preferences",
18-
"children":
19-
[
20-
{
21-
"caption": "Package Settings",
22-
"mnemonic": "P",
23-
"id": "package-settings",
24-
"children":
25-
[
26-
{
27-
"caption": "PHP Getters and Setters",
28-
"children":
29-
[
30-
{
31-
"command": "open_file",
32-
"args": {"file": "${packages}/PHP Getters and Setters/php-getters-setters.sublime-settings"},
33-
"caption": "Settings – Default"
34-
},
35-
{
36-
"command": "open_file",
37-
"args": {"file": "${packages}/User/php-getters-setters.sublime-settings"},
38-
"caption": "Settings – User"
39-
}
40-
41-
]
42-
}
43-
]
44-
}
45-
]
46-
}
2+
{
3+
"id": "tools",
4+
"caption": "Tools",
5+
"children": [
6+
{
7+
"caption": "PHP Getters and Setters...",
8+
"command": "show_overlay",
9+
"args": { "overlay": "command_palette", "text": "PHP: Generate" }
10+
}
11+
]
12+
},
13+
{
14+
"id": "preferences",
15+
"children": [
16+
{
17+
"caption": "Package Settings",
18+
"mnemonic": "P",
19+
"id": "package-settings",
20+
"children": [
21+
{
22+
"caption": "PHP Getters and Setters",
23+
"command": "edit_settings",
24+
"args": {
25+
"base_file": "${packages}/PHP Getters and Setters/PHP Getters Setters.sublime-settings",
26+
"default": "// See the left pane for the list of settings and valid values\n{\n\t$0\n}\n"
27+
}
28+
}
29+
]
30+
}
31+
]
32+
}
4733
]

php-getter-setter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def msg(msg):
2323
print("[PHP Getters and Setters] %s" % msg)
2424

2525
def prefs():
26-
return sublime.load_settings('php-getters-setters.sublime-settings')
26+
return sublime.load_settings('PHP Getters Setters.sublime-settings')
2727

2828

2929
class TemplateManager:

0 commit comments

Comments
 (0)