Skip to content

Commit b44449f

Browse files
Mehedi HassanMehedi Hassan
Mehedi Hassan
authored and
Mehedi Hassan
committed
Initial commit
0 parents  commit b44449f

File tree

7 files changed

+2744
-0
lines changed

7 files changed

+2744
-0
lines changed

.vscode/launch.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": "0.1.0",
3+
"configurations": [
4+
{
5+
"name": "Launch Extension",
6+
"type": "extensionHost",
7+
"request": "launch",
8+
"runtimeExecutable": "${execPath}",
9+
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
10+
"stopOnEntry": false
11+
}
12+
]
13+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Mehedi Hassan
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# PHP Namespace Resolver
2+
3+
PHP Namespace Resolver can import, expand and sort your namespaces.
4+
5+
## Commands
6+
7+
Search these commands by the title on command palette.
8+
9+
```json
10+
[
11+
{
12+
"title": "Import Namespace",
13+
"command": "namespaceResolver.import"
14+
},
15+
{
16+
"title": "Expand Namespace",
17+
"command": "namespaceResolver.expand"
18+
},
19+
{
20+
"title": "Sort Namespaces",
21+
"command": "namespaceResolver.sort"
22+
}
23+
]
24+
```
25+
26+
## Keybindings
27+
28+
You can override these default keybindings on your `keybindings.json`.
29+
30+
```json
31+
[
32+
{
33+
"command": "namespaceResolver.import",
34+
"key": "f1"
35+
},
36+
{
37+
"command": "namespaceResolver.expand",
38+
"key": "f2"
39+
},
40+
{
41+
"command": "namespaceResolver.sort",
42+
"key": "f3"
43+
}
44+
]
45+
```
46+
47+
## Settings
48+
49+
```json
50+
[
51+
"namespaceResolver.autoSort": {
52+
"type": "boolean",
53+
"default": true,
54+
"description": "Auto sort use statements by line length after imports."
55+
},
56+
"namespaceResolver.leadingSeparator": {
57+
"type": "boolean",
58+
"default": true,
59+
"description": "Expand with leading namespace separator."
60+
},
61+
"namespaceResolver.messagesOnStatusBar": {
62+
"type": "boolean",
63+
"default": false,
64+
"description": "Show messages on status bar."
65+
}
66+
]
67+
```
68+
69+
## Context Menu
70+
71+
```json
72+
[
73+
{
74+
"command": "namespaceResolver.import",
75+
"group": "navigation",
76+
"when": "!editorHasSelection"
77+
},
78+
{
79+
"command": "namespaceResolver.expand",
80+
"group": "navigation"
81+
},
82+
{
83+
"command": "namespaceResolver.sort",
84+
"group": "navigation"
85+
}
86+
]
87+
```
88+
89+
## Author
90+
91+
- [Mehedi Hassan](https://www.facebook.com/MehediDracula)
92+
- [@MehediDracula](https://twitter.com/MehediDracula)
93+
94+
## License
95+
96+
[MIT](LICENSE) License.
97+
98+
Copyright (c) 2017 Mehedi Hassan

images/icon.png

34.5 KB
Loading

package.json

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
{
2+
"name": "php-namespace-resolver",
3+
"displayName": "PHP Namespace Resolver",
4+
"description": "Sort Expand Import PHP Namespace.",
5+
"version": "0.0.1",
6+
"publisher": "MehediDracula",
7+
"engines": {
8+
"vscode": "^1.15.0"
9+
},
10+
"categories": [
11+
"Other"
12+
],
13+
"activationEvents": [
14+
"onCommand:namespaceResolver.import",
15+
"onCommand:namespaceResolver.expand",
16+
"onCommand:namespaceResolver.sort"
17+
],
18+
"main": "./src/extension",
19+
"icon": "./images/icon.png",
20+
"contributes": {
21+
"menus": {
22+
"editor/context": [
23+
{
24+
"command": "namespaceResolver.import",
25+
"group": "navigation",
26+
"when": "!editorHasSelection"
27+
},
28+
{
29+
"command": "namespaceResolver.expand",
30+
"group": "navigation"
31+
},
32+
{
33+
"command": "namespaceResolver.sort",
34+
"group": "navigation"
35+
}
36+
]
37+
},
38+
"configuration": {
39+
"type": "object",
40+
"title": "Resolve PHP Namespace ectension configuration.",
41+
"properties": {
42+
"namespaceResolver.autoSort": {
43+
"type": "boolean",
44+
"default": true,
45+
"description": "Auto sort use statements by line length after imports."
46+
},
47+
"namespaceResolver.leadingSeparator": {
48+
"type": "boolean",
49+
"default": true,
50+
"description": "Expand with leading namespace separator."
51+
},
52+
"namespaceResolver.messagesOnStatusBar": {
53+
"type": "boolean",
54+
"default": false,
55+
"description": "Show messages on status bar."
56+
}
57+
}
58+
},
59+
"commands": [
60+
{
61+
"title": "Import Namespace",
62+
"command": "namespaceResolver.import"
63+
},
64+
{
65+
"title": "Expand Namespace",
66+
"command": "namespaceResolver.expand"
67+
},
68+
{
69+
"title": "Sort Namespaces",
70+
"command": "namespaceResolver.sort"
71+
}
72+
],
73+
"keybindings": [
74+
{
75+
"command": "namespaceResolver.import",
76+
"key": "f1"
77+
},
78+
{
79+
"command": "namespaceResolver.expand",
80+
"key": "f2"
81+
},
82+
{
83+
"command": "namespaceResolver.sort",
84+
"key": "f3"
85+
}
86+
]
87+
},
88+
"scripts": {
89+
"postinstall": "node ./node_modules/vscode/bin/install"
90+
},
91+
"devDependencies": {
92+
"vscode": "^1.0.0"
93+
}
94+
}

0 commit comments

Comments
 (0)