Skip to content

Commit

Permalink
importAll method added to config
Browse files Browse the repository at this point in the history
  • Loading branch information
rrd108 committed Jan 10, 2019
1 parent a23fb12 commit c616287
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
18 changes: 17 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"onLanguage:php",
"onCommand:namespaceResolver.import",
"onCommand:namespaceResolver.expand",
"onCommand:namespaceResolver.sort"
"onCommand:namespaceResolver.sort",
"onCommand:namespaceResolver.importall"
],
"main": "./src/extension",
"icon": "images/icon.png",
Expand All @@ -51,6 +52,12 @@
"command": "namespaceResolver.sort",
"alt": "namespaceResolver.sort",
"group": "0_namespace_resolver@3"
},
{
"when": "resourceLangId == php",
"command": "namespaceResolver.importall",
"alt": "namespaceResolver.importall",
"group": "0_namespace_resolver@4"
}
]
},
Expand Down Expand Up @@ -107,6 +114,10 @@
{
"title": "Sort Imports",
"command": "namespaceResolver.sort"
},
{
"title": "Import All Classes",
"command": "namespaceResolver.importall"
}
],
"keybindings": [
Expand All @@ -124,6 +135,11 @@
"command": "namespaceResolver.sort",
"key": "ctrl+alt+s",
"when": "editorTextFocus"
},
{
"command": "namespaceResolver.importall",
"key": "ctrl+alt+a",
"when": "editorTextFocus"
}
]
},
Expand Down
2 changes: 2 additions & 0 deletions src/Resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class Resolver {
this.importClass(selection, fqcn, replaceClassAfterImport);
}

async importAll() {
}
importClass(selection, fqcn, replaceClassAfterImport = false) {
let useStatements, declarationLines;

Expand Down
6 changes: 6 additions & 0 deletions src/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ function activate(context) {
})
);

context.subscriptions.push(
vscode.commands.registerCommand('namespaceResolver.importall', async () => {
await resolver.importAll();
})
);

context.subscriptions.push(
vscode.commands.registerCommand('namespaceResolver.expand', async () => {
let selections = vscode.window.activeTextEditor.selections;
Expand Down

0 comments on commit c616287

Please sign in to comment.