Skip to content

Commit

Permalink
add deployOpenFilesToServer command
Browse files Browse the repository at this point in the history
  • Loading branch information
xjsender committed Aug 24, 2019
1 parent 24c46e6 commit e82543f
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@
"title": "%extension.haoide.deployThisToServer.title%",
"category": "Haoide"
},
{
"command": "extension.haoide.deployOpenFilesToServer",
"title": "%extension.haoide.deployOpenFilesToServer.title%",
"category": "Haoide"
},
{
"command": "extension.haoide.reloadSobjectCache",
"title": "%extension.haoide.reloadSobjectCache.title%",
Expand Down Expand Up @@ -177,6 +182,10 @@
"command": "extension.haoide.deployThisToServer",
"when": "haoide.hasOpenProject"
},
{
"command": "extension.haoide.deployOpenFilesToServer",
"when": "haoide.hasOpenProject"
},
{
"command": "extension.haoide.reloadSobjectCache",
"when": "haoide.hasOpenProject"
Expand Down
1 change: 1 addition & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"extension.haoide.retrieveThisFromServer.title": "Retrieve This File From Server",
"extension.haoide.retrieveOpenFilesFromServer.title": "Retrieve Open File From Server",
"extension.haoide.deployThisToServer.title": "Deploy This Files to Server",
"extension.haoide.deployOpenFilesToServer.title": "Deploy Open Files to Server",
"extension.haoide.reloadSobjectCache.title": "Reload sObject Cache",
"extension.haoide.formatJson.title": "Format JSON",
"extension.haoide.convertXml2Json.title": "Convert XML to JSON",
Expand Down
17 changes: 17 additions & 0 deletions src/commands/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,23 @@ export function deployThisToServer() {
}
}

/**
* Deploy open files to server
*/
export function deployOpenFilesToServer() {
let documents: vscode.TextDocument[] = vscode.workspace.textDocuments;
if (documents) {
let fileNames: string[] = [];
for (const doc of documents) {
fileNames.push(doc.fileName);
}
deployFilesToServer(fileNames);
}
else {
util.showCommandWarning();
}
}

/**
* Deploy files to server
* @param files files to be deployed
Expand Down
6 changes: 6 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ export function activate(context: vscode.ExtensionContext) {
main.deployThisToServer
));

// Register deployOpenFilesToServer command
context.subscriptions.push(vscode.commands.registerCommand(
"extension.haoide.deployOpenFilesToServer",
main.deployOpenFilesToServer
));

// Register switchProject command
context.subscriptions.push(vscode.commands.registerCommand(
"extension.haoide.switchProject", utility.switchProject
Expand Down

0 comments on commit e82543f

Please sign in to comment.